scripting - How to display AD group name next to AD user with PowerShell -


I am a new PowerShell user and am trying to figure out how to get a list of users from a group name group Desired output:

  Username AD Group Department John SG-MS Office Jen SG-MSOffice Accounting Sam SG-MS Office Accounting Thomas SG-MS Office IT  

Current Output:

Code:

  Get-ADGroupMember- Familiar SG-MS Office |  

Output:

  Department Distinguished Name Manager Name ObjectClass Objectune  

Store the name of the group from anywhere and you want to use Select-object to format the output, such as:

Group name = "SG-MSOffice" received - ADGroup member - ID $ groupname | @ - {n = "Eddy Group"; E = {$ groupname}}, section "username"; E = {$ _. Name}} -Object-property @ P> I do not remember that if the department is available in "default" -object, if not, then you would like Get-ADObject Some may include:

  $ groupname = "SG-MSOffice" Go -Adigroup member-Indentity $ groupname | Get ADObject -Properties Name, Department | @ - {n = "Eddy Group"; E = {$ groupname}}, section  
"username"; E = {$ _. Name}} -Object-property @ / div>

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -