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

PowerShellでActive Directoryを操作してみよう (グループ編)

PowerShellでActive Directoryを操作してみよう (グループ編)

minase

June 07, 2016
Tweet

More Decks by minase

Other Decks in Programming

Transcript

  1. None
  2. None
  3. • • •

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

  5. • • • Get-ADGroup -Filter * Get-ADGroup -Filter * -SearchBase

    'OUのDN' Get-ADGroup -Filter {Name -like "*開発管理部*"}
  6. • • Get-ADGroupMember -Identity 'TestGroup' Get-ADGroupMember -Identity 'TestGroup' | Select-Object

    {$_.SamAccountName}
  7. • New-ADGroup -Name 'TestGroup' ` -Description 'test' ` -GroupScope Global

    ` -GroupCategory Security ` -Path '作成先OUのDN'
  8. • • • • Set-ADGroup -Identity 'TestGroup' -Description 'Change' Rename-ADObject

    -Identity 'グループのDN' -NewName 'TestGroup' Set-ADGroup -Identity 'TestGrop' -GroupCategory Distribution Get-ADGroup -Identity 'TestGroup' | Set-ADGroup -Description 'change'
  9. • • • Remove-ADGroup -Identity 'TestGroup' Remove-ADGroup -Identity 'TestGroup' -Confirm:$false

    Get-ADGroup -Identity 'TestGroup' | Remove-ADGroup
  10. • • • • Add-ADGroupMember -Identity 'TestGroup' -Members minase,isami Remove-ADGroupMember

    -Identity 'TestGroup' -Members yamashita Get-ADGroup -Identity 'TestGroup' | Add-ADGroupMember -Members yamashita Get-ADGroup -Identity 'TestGroup' | Remove-ADGroupMember -Members isami
  11. None