Category Archives: Scripting

Freeradius: remove VLAN tag when request comes from specific client

I have a RADIUS server which is configured to add VLAN tags based on the LDAP groups the user is a member of. However in my situation I also need my RADIUS to authenticate users who connect to equipment in … Continue reading

Posted in Scripting | Tagged , , , , , , , | Leave a comment

Installing .NET Framework 3.5 on Windows Server 2012 Server Core

Mount or insert the windows 2012 server media, in my case the mount-point is “D:\”. Run the following command from powershell. PS> import-module servermanager PS> Install-WindowsFeature NET-Framework-Core -Source D:\sources\sxs    

Posted in Scripting, Windows Server | Tagged , , , , , | Leave a comment

Use Powershell to check if Windows Update patch is installed

Here is a powershell function to check if a windows update patch is installed or not. It will return $True if it is installed and $False if it is not installed. function Check-IsPatchInstalled { #Øyvind Nilsen, oyvindnilsen.com PARAM ( [Parameter(Mandatory=$false,ValueFromPipeline=$false)][String]$computer … Continue reading

Posted in Scripting | Tagged , , , , , , , , , , , , | 1 Comment

Powershell function to check if Active Directory users exists

Here is a little powershell function I made to see check if specific active directory users exists or not. #POWERSHELL function userExists ([string]$name){ #written by: Øyvind Nilsen (oyvindnilsen.com) [bool]$ret = $false #return variable $domainRoot = [ADSI]” $dirSearcher = New-Object System.DirectoryServices.DirectorySearcher($domainRoot) … Continue reading

Posted in Scripting | Tagged , , , , , , , , , | Leave a comment

One line in powershell to check if remote port is open

Here is an easy way to use powershell to see if a remote machine is listening on a specific port. If the command finishes without returning anything the remote machine is listening on the port. If the commands times out … Continue reading

Posted in Scripting | Tagged , , , , , , , , , , , | Leave a comment