uj könyvtär Scripts
This commit is contained in:
33
Scripts/powershell/Benutzer_Data.ps1
Normal file
33
Scripts/powershell/Benutzer_Data.ps1
Normal file
@@ -0,0 +1,33 @@
|
||||
Import-Module ActiveDirectory -ErrorAction Stop
|
||||
|
||||
$out = 'C:\Apps\all_ad_users.csv'
|
||||
|
||||
Get-ADUser -Filter * -Properties mail,telephoneNumber,mobile,fax,physicalDeliveryOfficeName,department,title,Enabled |
|
||||
Select-Object @{
|
||||
Name='Name';Expression={$_.Name}
|
||||
}, @{
|
||||
Name='SamAccountName';Expression={$_.SamAccountName}
|
||||
}, @{
|
||||
Name='Mail';Expression={$_.mail}
|
||||
}, @{
|
||||
Name='Telephone';Expression={$_.telephoneNumber}
|
||||
}, @{
|
||||
Name='Mobile';Expression={$_.mobile}
|
||||
}, @{
|
||||
Name='Fax_business';Expression={$_.fax}
|
||||
}, @{
|
||||
Name='Office';Expression={$_.physicalDeliveryOfficeName}
|
||||
}, @{
|
||||
Name='Department';Expression={$_.department}
|
||||
}, @{
|
||||
Name='Title';Expression={$_.title}
|
||||
}, @{
|
||||
Name='Enabled';Expression={$_.Enabled}
|
||||
} |
|
||||
Tee-Object -Variable Results |
|
||||
Export-Csv -Path $out -NoTypeInformation -Encoding UTF8
|
||||
|
||||
# konzolra formázott megjelenítés (szükség szerint szűrj)
|
||||
$Results | Format-Table Name,SamAccountName,Mail,Telephone,Mobile,Fax_business,Office,Department,Title,Enabled -AutoSize
|
||||
|
||||
Write-Host "Kimenet: $out ($($Results.Count) felhasználó)"
|
||||
Reference in New Issue
Block a user