$30 off During Our Annual Pro Sale. View Details »

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

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

minase

June 06, 2016
Tweet

More Decks by minase

Other Decks in Programming

Transcript

  1. None
  2. • • •

  3. • Set-ExecutionPolicy RemoteSigned • Import-Module ActiveDirectory

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

    EmailAddress • Get-ADUser -Filter * -SearchBase DN • Get-ADUser -Filter {name -like "水無瀬*"}
  5. None
  6. • • New-ADUser ` -Name "水無瀬 忠正" -UserPrincipalName "minase@stars.kdl.co.jp" `

    -SamAccountName "minase" ` -Enabled $true ` -Surname "水無瀬" ` -GivenName "忠正" ` -DisplayName "水無瀬 忠正" ` -PasswordNotRequired $true ` -Path DN
  7. • • Set-ADUser ` -Identity "minase" ` -EmailAddress "minase@kdl.co.jp" •

    Get-ADUser ` -Filter {name -like "水無瀬*"} ` | Set-ADUser -EmailAddress "minase@kdl.co.jp"
  8. • • Remove-ADUser "minase" • Remove-ADUser -Identity DN • Get-ADUser

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