U
U
Uncle Seryozha2015-12-15 17:31:53
PowerShell
Uncle Seryozha, 2015-12-15 17:31:53

How to upload user rights in AD groups as a table?

Tell me how to unload the table of access rights from AD and with what:
_______Group1_|_Group2_|_Group3
User1____+_____|___________|___+____
User2__________|_____+_____|_______
User3____+_____|___________|_______
?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Kolmykov, 2015-12-15
@Protos

I write from memory, without the possibility of checking:

Import-Module ActiveDirectory
$userList = Get-Aduser -Filter *
foreach($user in $userlist)
{
  [array]$userGroups = Add-ADPrincipalGroupMembership -Identity $user.samaccountname
  $result = $user.samaccountname + "`t" + $user.displayName + "`t" + ($userGroups.name -join "; ")
  Out-file -InputObject $result -FilePath "C:\result.csv" -Append  # Если в файл вывод не нужен, то "Write-Host $result"
}

P
Puma Thailand, 2015-12-15
@opium

write the script yourself, there are probably a bunch of commands in the power shell for working with hell, including finding out which group the user is in.

E
Eugene, 2015-12-15
@yellowmew

import-module activedirectory
get-command -module activedirectory
and as a fatter hint:
get-help get-adgroup -examples
get-help get-adgroupmember -examples
Powershell, of course. =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question