?
Solved

Get-qadgroup from a list of files which has groups

Posted on 2012-09-18
10
Medium Priority
?
1,044 Views
Last Modified: 2012-09-19
I have an input file with 10 groups.

Need to import the input file and get the below command.

Qet-Qadgroup -id $_ | get-qadgroupmember -indirect -includeallproperties | select samaccountname,useraccountcontrol.

Just need the syntax of how to import a group and get the required output.

Is there any similar command in windows powershell  to accept group of users and get the nested group members name with useraccountcontrol.
0
Comment
Question by:AhmedAliShaik
  • 5
  • 3
  • 2
10 Comments
 
LVL 39

Accepted Solution

by:
Krzysztof Pytko earned 1200 total points
ID: 38409180
If it is flat text file then use
Get-Content c:\groups.txt | %{ Get-QADgroup -id $_ | Get-QADGroupMember -Indirect -Includeallproperties | select samaccountname,useraccountcontrol }

Open in new window


or for CSV file
Import-CSV c:\groups.csv | %{ Get-QADgroup -id $_."groupName" | Get-QADGroupMember -Indirect -Includeallproperties | select samaccountname,useraccountcontrol }

Open in new window


Regards,
Krzysztof
0
 
LVL 2

Author Comment

by:AhmedAliShaik
ID: 38409219
Hi Krzysztof,

After a long time . Good to meet u here virtually.

Will try the command and post you.

Do  we have the equivalent windows powershell script, as i have a script to pull local admintrator users from a list of computers in windows powershell, i can club both the commands as per requirement.
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 38409254
Could you elaborate more, best with an example, about what you expect to do and get?
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
LVL 2

Author Comment

by:AhmedAliShaik
ID: 38409262
As the quest command is giving the nested members with samaccountname & useraccountcontrol from the input groups.

Can we get the same output from Windows Powershell script.

Kindly let you know if u need more clarification.
0
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 38409336
Hi Ahmed :)

if you mean Windows PowerShell module for AD, yes it is also possible using Get-ADUser cmd-let

If you wish to use regular PowerShell v1.0 or 2.0, you need to use some other queries like ADSI but I have no experience with that, so you need to wait for other experts (i.e Qlemo)

Krzysztof
0
 
LVL 2

Author Comment

by:AhmedAliShaik
ID: 38410742
Thanks a lot Krzysztof.

I will wait for Qlemo's response.
0
 
LVL 71

Assisted Solution

by:Qlemo
Qlemo earned 800 total points
ID: 38411808
It's more difficult than that - Get-ADUser is available with RSAT, requiring W2008R2 and the AD Web Services. So we are bound to use LDAP queries (ADSI) here, and that's a much different beast, one I'm not able to tame at the moment.
I'll might come back, but I would not count on it.

Being a Topic Advisor, I could set this question to neglected to get the attention of more Experts, but doubt that there will be any because of the title. I recommend to accept the answer of Krzysztof (maybe with 250 points instead of 500), and ask a new question (referring to this one) for how to do that without the Quest cmdlets.
0
 
LVL 2

Author Comment

by:AhmedAliShaik
ID: 38412037
Thanks for your reply.

I ask a new question referring the case.
0
 
LVL 2

Author Closing Comment

by:AhmedAliShaik
ID: 38412044
Thanks.
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 38412659
I did not expect to get points for that, but they are welcome!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question