블로그 이미지
bedbmsguru

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
  • total
  • today
  • yesterday

'2018/12/26'에 해당되는 글 1건

  1. 2018.12.26 AD계정 정보 가져오기
2018. 12. 26. 16:24 Powershell

column customizing 포함


$a = @{Expression={$_.SamAccountName}; Label="Column 1"; Width=50},
@{Expression={$_.surName}; Label="Column 2"; Width=50},
@{Expression={$_.Description}; Label="Column 3"; Width=50},
@{Expression={$_.Created}; Label="Column 4"; Width=50},
@{Expression={$_.LastLogonDate}; Label="Column 4"; Width=50}

Get-ADUser -Properties SamAccountName, surName, Description, Created, LastLogonDate -Filter {ObjectClass -eq "user"} -SearchBase "OU=MYOU,DC=mydc,DC=co,DC=kr" | Sort-Object -property SamAccountName | Select-object SamAccountName, surName, Description, Created, LastLogonDate | Format-Table -property $a > d:\aa.txt 

posted by bedbmsguru