-
By Jean Powershell Needful Things. Some Powershell scripts that I have created, which may help you. Monday, March 16, 2009. Audit the local Administrators group on a list of remote computers. This is a very basic script which collects a list of ... Read More
-
Hi p3dr0, Sorry for that alias. :) Here is a collection of code snippets that use WinNT moniker that you could find useful: # the domain groups membership $user = [ADSI]"WinNT://$env:userdomain/$username,user" $user.groups() | ForEach-Object {$_.GetType().InvokeMember('Name','GetProperty'...
-
This solution uses ADSI and the .NET Framework to retrieve the name of the user's primary group: $rootDN = ([adsi]"").distinguishedName $user = [adsi]("LDAP://CN=testuser,OU=Test," + $rootDN) $groupID = $user.primaryGroupID $arrSID = $user.objectSid.Value $SID = New-Object System...
-
Hi All, Is it possible using powershell to add certain domain username into Local Administrator group of the whole server in the domain ? Example script that I usually modify and re-use (see attached) $OnlineServers = @() Get-QADComputer -SearchRoot 'domain.com/PRODUCTION servers' -OSName "Windows...
-
Hi, I don't know if it is possible with powershell to create and remove local server / PC username for non domain joined server ? As for the domain member server, we can use ADSI. Thanks.
-
Steve Schofield demostrates how to list local administrators on a machine using PowerShell and the ADSI provider. Read more