powershell

PowerShell 2.0: One Cmdlet at a Time 55 Disable-WSManCredSSP

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Disable-WSManCredSSP cmdlet. What can I do with it? Disable CredSSP configuration on a computer. Note: this cmdlet requires running from an elevated PowerShell session. Example: Disable the CredSSP configuration on the local computer which has previously been enabled for client CredSSP via Enable-WSManCredSSP. Confirm this has been successful with Get-WSManCredSSP. Disable-WSManCredSSP -Role client Get-WSManCredSSP

PowerShell 2.0: One Cmdlet at a Time 52 New-WSManSessionOption

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the New-WSManSessionOption cmdlet. What can I do with it? Create a session option hash table for use with the WS-Management cmdlets Get-WSManInstance, Set-WSManInstance, Invoke-WSManAction and Connect-WSMan. Example: Create a session option hash table for use with the Set-WSManInstance cmdlet to update the HTTPS listener created with New-WSManInstance . $options = New-WSManSessionOption -OperationTimeout 1000 -SkipRevocationCheck Set-WSManInstance winrm/config/listener -SelectorSet @{address="*";transport=“https”} -SessionOption $options

PowerShell 2.0: One Cmdlet at a Time 51 Remove-WSManInstance

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Remove-WSManInstance cmdlet. What can I do with it? Remove a management resource that has been previously created for use with WS-Management. Example: Check for existing HTTPS Listeners. Remove the existing HTTPS listener created with New-WSManInstance . Check again to confirm its removal. Get-WSManInstance winrm/config/listener -selectorset @{Address="*";Transport=“https”} Remove-WSManInstance winrm/config/listener -SelectorSet @{address="*";transport=“https”} Get-WSManInstance winrm/config/listener -selectorset @{Address="*";Transport=“https”}

PowerShell 2.0: One Cmdlet at a Time 50 Set-WSManInstance

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Set-WSManInstance cmdlet. What can I do with it? Change the properties of a management resource for use with WS-Management. Example: Set the Enabled property of the HTTPS listener created with New-WSManInstance to false, effectively disabling it. Tip: watch out for case sensitivity in ValueSet Set-WSManInstance winrm/config/listener -SelectorSet @{address="*";transport=“https”} -ValueSet @{Enabled=“false”} How could I have done this in PowerShell 1.

PowerShell 2.0: One Cmdlet at a Time 49 New-WSManInstance

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the New-WSManInstance cmdlet. What can I do with it? Create an instance of a management resource for use with WS-Management. Example: Create an instance of a management resource for use with WS-Management using HTTPS. You need to specify a certificate for use with this listener since it is HTTPS. For testing purposes it is possible to create a self-signed certificate within IIS.

PowerShell 2.0: One Cmdlet at a Time 48 Get-WSManInstance

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Get-WSManInstance cmdlet. What can I do with it? Retrieve an instance of a management resource specified by a URI by using WS-Management. Examples: Display management information for the BITS service on the remote computer Test01. Get-WSManInstance wmicimv2/win32_service -selectorset @{name=“BITS”} -computername Test01 Notice that you receive many properties for the BITS service. Display management information for the WS-Management listener configuration on the remote computer Test01.

PowerShell 2.0: One Cmdlet at a Time 46 Test-WSMan

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Test-WSMan cmdlet. What can I do with it? Test whether WS-Management is available on a computer. Example: Test whether WS-Management is available on Test01. Test-WSMan -ComputerName Test01 You will notice you receive a response detailing wsmid, ProtocolVersion, ProductVendor and ProductVersion if the query is successful. How could I have done this in PowerShell 1.

PowerShell 2.0: One Cmdlet at a Time 47 Invoke-WSManAction

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Invoke-WSManAction cmdlet. What can I do with it? Invoke an action using WS-Management . Examples: Check the status of the BITS service on Test01, use WS-Management to stop the service, then check its status again. Get-Service BITS -ComputerName Test01 Invoke-WSManAction -Action StopService -resourceuri wmicimv2/Win32_Service -SelectorSet @{Name=“BITS”} -ComputerName Test01 -Authentication Default Get-Service BITS -ComputerName Test01

PowerShell 2.0: One Cmdlet at a Time 45 Connect-WSMan

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Connect-WSMan cmdlet. What can I do with it? Create a connection to a remote computer using WS-Management . Example: Connect to the remote server Test01 using WS-Management . Use the WSMan provider to examine the WSMan Shell properties and change the value for MaxShellsPerUser to 10. Connect-WSMan -ComputerName Test01 cd wsman: dir cd .

Active Directory: How do you solve a problem like Maria? Or John Smith?

The larger your organisation gets so do the number of users within your Active Directory and consequently the chances of employing people with the same name. Unless you have good naming policies from the start you may well end up with an untidy directory and if you are using Exchange an address book where it is hard to distinguish between people with the same Display Name. The below script will generate you a report listing all users whose Display Name matches that of somebody else and for instance what a new Display Name would look like if you added their department field in brackets after their name - of course you could use another field entirely to distinguish them.