PowerShell

In this Article, we will see how to add user or users or Computer using Powershell. If you want to add users to the specific one Group, you can use the below command.. $domain=”Windowstechpro.com” $Computer = $env:COMPUTERNAME; $ADSIComputer = [ADSI](“WinNT://$Computer,computer”); $SGName = $ADSIComputer.psbase.children.find(‘Administrators’) function Groupmember($number) { $SGName.add(“WinNT://”+$domain+”/”+$number ) } Groupmember “radhakrishnan.govindan”  Groupmember “veterivel.Madeshwaran”  In the…

Continue reading How to add domain users to the Local Groups using Powershell

Some time we will be having requirement to convert SID to Group/User Name or Group/User Name to SID. Here I will show you simple way to do that using PowerShell. How to Convert Group/User Name to SID: Syntax:   $Name = “Group or User Name”   (New-Object System.Security.Principal.NTAccount($Name)).Translate([System.Security.Principal.SecurityIdentifier]).value Example: $Name = “Trace-Restriction”  (New-Object System.Security.Principal.NTAccount($Name)).Translate([System.Security.Principal.SecurityIdentifier]).value   How to Convert…

Continue reading How to Convert SID to User Name using PowerShell