Your SlideShare is downloading. ×
0
×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Windows power shell and active directory

685

Published on

Quick over view of windows powershell and active directory, runs though some of the common and often used command sets

Quick over view of windows powershell and active directory, runs though some of the common and often used command sets

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
685
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • http://asdirkseesit.blogspot.com/2012/10/powershell-bulk-adding-users-active.html
  • http://asdirkseesit.blogspot.com/2012/10/powershell-bulk-adding-users-active.html
  • Transcript

    • 1. CIS 216Highline Community CollegeDan Morrill
    • 2.  Windows Server 2008 R2 Active Directory running and configured Windows Power Shell Windows Active Directory PowerShell command list http://technet.microsoft.com/en-us/library/ee617195.aspx A couple of users in Active Directory that we canmanipulate
    • 3.  DCPromo starts up a New Active Directory Forrest For this case your AD should be on its own and not partof a regular AD Domain. All users will be local to the isolated AD Domain The Domain Functional Level in this case does notmatter, you can choose 2003 or 2008 Add DNS and all the features needed for the ADprocess Run Active Directory Users and Computers underAdministrative Tools (start – administrative tools –users and computers)
    • 4.  We want to check out a user to see if the user exists inAD Get-aduser jackfrost
    • 5.  Disable-adaccount jackfrost Enable-adaccount jackfrost
    • 6.  Type sl ad: You should see this prompt
    • 7.  Type DIR (while in SL-AD) You should see this
    • 8.  Set-location“dc=instructorCIS216,dc=highline,dc=edu” Use the FDQN you set up when you installed ActiveDirectory for the location and remember the quotes
    • 9.  Set-location “cn=users” Dir
    • 10.  New-PSDrive –Name instructor –PSProvderActiveDirectory –Root“ad:dc=instructorCIS216,dc=highline,dc=edu”
    • 11.  Get-item“ad:cn=users,dc=instructorCIS216,dc=highline,dc=edu” –Properties samAccountName
    • 12.  Get-item‘ad:cn=users,dc=instructorCIS216,dc=highline,dc=edu’ –Properties *
    • 13.  Import-Module ActiveDirectory$Users = Import-Csv ".myusers.csv"foreach ($User in $Users){$OU = "OU=MyUsers,OU=MyStuff,DC=mydomain,DC=local,DC=com"$Detailedname = $User.firstname + " " + $User.lastname$Firstname = $User.Firstname$FirstLetterFirstname = $Firstname.substring(0,1) #not used this but left it in$SAM = $User.Firstname.tolower() + "." + $user.lastname.tolower()$userprinci = $SAM + "@mydomain.local.com"$logonscript = "logscript.vbs"$homedir = "servermyarea" + $SAM + "My Documents"#tried this alternative#$homedir = "servermyarea%username%My Documents"New-ADUser -Name $Detailedname -SamAccountName $SAM -UserPrincipalName$userprinci -DisplayName $Detailedname -GivenName$user.firstname -Surname $user.lastname -Path $OU -HomeDrive "H:" -HomeDirectory$homedir -scriptpath $logonscript -PasswordNeverExpires $True -PassThru#the password is blank on this example}
    • 14.  You have all the basic commands The script on the preceding page requires a CSV file ofuser names Look at how the script was set up to determine whatshould be in the CSV file, (detailedName, FirstName,FirstLetterFirstName, SAM, ect) Build a CSV with those headers and enter a couple ofentries in the file Attempt to import Submit the CSV file, and a screen cap of the AD UsersContainer with your new people

    ×