Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
General PowerShell
Get-QADUser If Member question
Last Post 30 Sep 2009 09:26 AM by
link1277
. 0 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
link1277
New Member
Posts:65
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.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2