Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PowerShellでActive Directoryを操作してみよう (ユーザ編)

PowerShellでActive Directoryを操作してみよう (ユーザ編)

minase

June 06, 2016
Tweet

More Decks by minase

Other Decks in Programming

Transcript

  1. • • Get-ADUser -Filter * • Get-ADUser -Filter * -Properties

    EmailAddress • Get-ADUser -Filter * -SearchBase DN • Get-ADUser -Filter {name -like "水無瀬*"}
  2. • • New-ADUser ` -Name "水無瀬 忠正" -UserPrincipalName "[email protected]" `

    -SamAccountName "minase" ` -Enabled $true ` -Surname "水無瀬" ` -GivenName "忠正" ` -DisplayName "水無瀬 忠正" ` -PasswordNotRequired $true ` -Path DN
  3. • • Set-ADUser ` -Identity "minase" ` -EmailAddress "[email protected]" •

    Get-ADUser ` -Filter {name -like "水無瀬*"} ` | Set-ADUser -EmailAddress "[email protected]"
  4. • • Remove-ADUser "minase" • Remove-ADUser -Identity DN • Get-ADUser

    ` -filter {SamAccountName -eq "minase"} ` -SearchBase DN ` | Remove-ADUser