Here’s a quick one-liner to find out how old the administrator password age is on a remote machine. PS C:\> ([adsi]“WinNT://COMPUTERNAME/administrator”).passwordage.value/86400 This requires RPC/DCOM access to the remote computer...
Yesterday on Twitter, I got a tweet from @Docsmooth regarding how to update a multivalued property in Active Directory. There are a number of ways to handle this, especially from PowerShell naturally, so I tweeted one way in a series … Continue...
< # .SYNOPSIS This script uses ADSI to add a new OU to a domain. .DESCRIPTION This script creates a pointer to the domain, then uses the Create method to create a new OU under the root...
# Get-FSMOHolders.ps1 # Gets the names of the systems holding the 5 FSMO holders # Runs on a domain-joined machine # Thomas Lee - tfl@psp.co.uk # Get host,forest and domain details $Hostname = hostname $forest = [DirectoryServices.ActiveDirectory...
# Requires -Version 2.0 # Add-DomainUserToLocalAdministatorsGroup.ps1 # Add a domain user to a Local Administrator's group # Thomas Lee - tfl@psp.co.uk # Based on http://powershell.com/cs/media/p/380.aspx, with some error checking # Setup up information on user to add,etc $Domain = " Cookham...
# Get-Forest.ps1 # Shows use of GetCurrentForest to return information about the forest # Thomas Lee - tfl@psp.co.uk $forest = [System.DirectoryServices.ActiveDirectory.Forest] :: GetCurrentForest() " You are connected to the {0} forest " -f $forest .name This script produces the following...