header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Get-QADUser If Member question
Last Post 30 Sep 2009 09:26 AM by link1277. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
link1277User is Offline
New Member
New Member
Posts:65
Avatar

--
30 Sep 2009 09:26 AM
    Does anyone know of a way to do a PowerShell ifmember?

    I'm basically going through each users home directory which the folder name is equal to the users AD name.  I want to be able to see which of the 4 groups the users is member of then do something.

    Quota 1gb
    Quota 2gb
    Quota 3gb
    Quota 4gb

    $userdata = "H:\homedirs"
    $groupprefix = "Quota"

    foreach ($item in Get-ChildItem $userdata -Name){
      
    ### This is where I would see the ifmember thing, then run the Windows 2003 quota command line to set the quota.  I did come up with this line, just doesn't seem like the right way here.


    Get-QADMemberOf $item | Select-Object Name | Where-Object {$_.Name -match $groupprefix} | `
            dirquota quota add /path:"$userdata\$item" /sourcetemplate:$groupprefix


    Any ideas or advice to this?
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer