Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Need push over the edge on Powershell script.

$
0
0

So I have the following script written up:

Import-Module ActiveDirectory
Write-Host "Now generating a list of all Active Directory Groups. Please pick the group you need more information about and enter it below."
Get-ADGroup -filter  | Select displayname | Sort-Object displayname | Export-Csv c:\groups.txt -NoTypeInformation
Invoke-Item c:\groups.txt
$groupname = read-host "Enter the Group name you require information about."
Get-ADGroupMember $groupname | Select Name, samAccountName | Sort-Object Name | Export-CSV c:\groupmembers.txt -NoTypeInformation
Invoke-Item c:\groupmembers.txt

It is supposed to generate a text file and open it that displays all of our domain groups(which are in a lot of different OUs).

So what I am missing is the command to get the script to generate the text file and just display the Group names it finds in the Domain.

I've searched all over and haven't found what the missing context should be. When I use -filter *, the text file generates, but all it shows is "displayname" at the top and nothing else.

Is it possible to get this to display?


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>