Skip to content

Instantly share code, notes, and snippets.

@DexterPOSH
Last active August 29, 2015 13:55
Create SCCM Users
#region Create AD Users
#Import the Module
Import-Module -Name ActiveDirectory
$newUsers = "SMSadmin","Testuser","Testuser2","Testuser3","DomJoin","ReportsUser","ClientInstall","SCCMNAA"
#Create a Common Password..this is a Demo Environment
$Password = ConvertTo-SecureString -String "P@ssw0rd2" -AsPlainText -Force
foreach ($newuser in $newUsers)
{
New-ADUser -SamAccountName $newUser -Name $newuser -AccountPassword $Password -PassThru | Enable-ADAccount -Verbose
}
#endregion Create AD Users
#region Give AD Users Local Admin Access
#need to add the AD Users [ClientInstall,SMSadmin] to the Local Admin Group
([ADSI]"WinNT://DexSCCM/Administrators,group").add("WinNT://Dexter/ClientInstall")
([ADSI]"WinNT://DexSCCM/Administrators,group").add("WinNT://Dexter/SMSAdmin")
#endregion Give AD Users Local Admin Access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment