+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
How do you do....it? Thread, Display count of computers in an AD group? in Technical; just heading home from Bali via here. you could have a page which submits variables to the script (using a ...
  1. #16

    glennda's Avatar
    Join Date
    Jun 2009
    Location
    Sussex
    Posts
    7,817
    Thank Post
    272
    Thanked 1,138 Times in 1,034 Posts
    Rep Power
    350
    just heading home from Bali via here.

    you could have a page which submits variables to the script (using a simple form) and then at the top of script have $groupname $=_Request(groupname);

    then use a simple form with multiple inputs

    input type=text name=groupname etc

    T

  2. #17

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,054
    Thank Post
    888
    Thanked 1,729 Times in 1,492 Posts
    Blog Entries
    12
    Rep Power
    454
    Quote Originally Posted by Arthur View Post
    Here's one way of doing it...

    Code:
    Get-QADGroup (Read-Host "Enter your group name") -SizeLimit 0 | Select-Object Name,@{n='MemberCount';e={ (Get-QADGroupMember $_ | Measure-Object).Count}}
    Edit. Also worth mentioning is that if you have lots of groups with a similar names e.g. group1, group2, etc. You can simply enter group* when prompted.
    Hi me again :-)

    Is it supposed to be so slow? It takes ages for it to ask me for the group name and then when i enter the name it sits there from ages then the window disappears. It doesnt tell me the count ha ha

    This is my code if you can help?

    Thanks

    Code:
    if(!(Get-PSSnapin | Where {$_.name -eq "Quest.ActiveRoles.ADManagement"})) { 
        Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction 0 | Out-Null
    }
    Get-QADGroup (Read-Host "Enter your group name") -SizeLimit 0 | Select-Object Name,@{n='MemberCount';e={ (Get-QADGroupMember $_ | Measure-Object).Count}}

  3. #18


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    9,061
    Thank Post
    232
    Thanked 2,716 Times in 2,004 Posts
    Rep Power
    794
    Quote Originally Posted by FN-GM View Post
    Is it supposed to be so slow?
    It's really fast when I run it on one of my servers.

    Quote Originally Posted by FN-GM View Post
    It takes ages for it to ask me for the group name and then when I enter the name it sits there from ages then the window disappears.
    Do you have the Quest AD cmdlets installed and how are you running the script? Can you try the following, to see if they are any faster?

    Code:
    Add-PSSnapin Quest.ActiveRoles.ADManagement
    Get-QADGroup (Read-Host "Enter your group name") -SizeLimit 0 | Select-Object Name,@{n='MemberCount';e={ (Get-QADGroupMember $_ | Measure-Object).Count}}
    $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
    Code:
    Add-PSSnapin Quest.ActiveRoles.ADManagement
    Get-QADGroup "Your Group" -SizeLimit 0 | Select-Object Name,@{n='MemberCount';e={ (Get-QADGroupMember $_ | Measure-Object).Count}}
    $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
    What happens if you run the code you posted through the PowerShell ISE?

  4. #19

    broc's Avatar
    Join Date
    Jan 2006
    Location
    England
    Posts
    2,046
    Thank Post
    104
    Thanked 401 Times in 265 Posts
    Rep Power
    150
    If it is just a one-off query,

    In Active Directory Users and Computers, Open the AD directory tree, in the left hand frame click on the computer group, in the right hand frame select all members, right mouse button, select properties and it will give you a count in the group....

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Making better use of space in an ICT Suite
    By Little-Miss in forum How do you do....it?
    Replies: 15
    Last Post: 21st January 2014, 09:31 AM
  2. Multipoint Server in an AD environment
    By craigw in forum Thin Client and Virtual Machines
    Replies: 2
    Last Post: 15th February 2011, 08:14 AM
  3. [Fog] Fog Documentation: How to delete a group of computers in FOG
    By ssx4life in forum O/S Deployment
    Replies: 1
    Last Post: 9th November 2009, 01:59 PM
  4. how can i bulk add users to a an AD group
    By goodhead in forum Windows
    Replies: 5
    Last Post: 4th December 2008, 06:32 PM
  5. Replies: 5
    Last Post: 15th August 2008, 10:19 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •