script


# https://blogs.technet.microsoft.com/heyscriptingguy/2013/06/03/teched-2013-a-couple-of-scripts/

#Create AD Organizational Unit and 10 users

$NewOUSplat = @{
Name=”TechEd2013″
Description=”MyScript”
Path=”DC=NWTraders,DC=COM”
}
New-ADOrganizationalUnit @NewOUSplat

for ($i=1;$i -le 10;$i++) {
$NewUserSplat = @{
SamAccountName=”User$i”
Name=”User$i”
Path=”OU=TechEd2013,DC=NWTraders,DC=COM”
}
New-ADUser @NewUserSplat
}

Get-ADUser -Filter * -SearchBase “OU=TechEd2013,DC=NWTraders,DC=COM” |

select SamAccountName

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: