![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Experience with Set-QADObject for groups? I am trying to convert all of our global distribution groups to universal groups, but PS is giving me a hard time in this. What I have so far is: get-qadgroup -sizelimit 0 | where {($_.grouptype -eq "Distribution") -and ($_.groupscope -eq "Global")} | set-qadobject $_.dn -objectattributes @{groupscope='Universal'} The problem is that I can't seem to SET it this way. I know that in ADSI "GroupType" should be 8 for a Universal Distribution group, but when I look at the get-member on the object, the grouptype and groupscope seem to be a Quest implemented .NET representation of the data with no real way back to set it. Even $_.psbase doesn't give me the info I need from ADSI. Does anyone have a potential solution to access the ADSI data withOUT the ..NET representation layer? Many thanks! -- Kevin N. Kidder ---------------------------------------- "If at first you don't succeed, failure may be your style." |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Experience with Set-QADObject for groups? Kevin N. Kidder wrote:
www.powergui.org (in the discussion forums) if you want to still try to find a solution with the Quest AD cmdlets. Marco -- ---------------- PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest | Re: Experience with Set-QADObject for groups? Can you try this? "Kevin N. Kidder" <kkidder@xxxxxx> wrote in message news:0D056FAC-8BB0-4160-802B-56A83CD44A0C@xxxxxx
| ||||||||||||
| | #4 (permalink) | ||||||||||||
| Guest | Re: Experience with Set-QADObject for groups? Can you try this? In a lab of course ![]() #################### Param($domain) $root = [ADSI]"LDAP://$Domain" $filter = "(&(objectcategory=group)(groupType=2))" $ds = new-object System.DirectoryServices.DirectorySearcher($root,$filter) $groups = $ds.findall() foreach($group in $groups) { $grp = $group.GetDirectoryEntry() $grp.psbase.properties.grouptype $grp.PutEx(2,'groupType',@(8)) $grp.setinfo() } "Kevin N. Kidder" <kkidder@xxxxxx> wrote in message news:0D056FAC-8BB0-4160-802B-56A83CD44A0C@xxxxxx
| ||||||||||||
| | #5 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Experience with Set-QADObject for groups? I will give this a try, Thanks! "Brandon Shell" <tshell.mask@xxxxxx> wrote in message news:uXaM9p3$HHA.4592@xxxxxx
| ||||||||||||||||||||||||
| | #6 (permalink) | ||||||||||||
| Guest | RE: Experience with Set-QADObject for groups? Kevin, Try this: get-qadgroup -sizelimit 0 | where {($_.grouptype -eq "Distribution") -and ($_.groupscope -eq "Global")} | set-qadobject $_.dn -ObjectAttributes @{groupType=8} It is basically assigning that group type by using the native value - 8. In the future we will at some point have Set-QADGroup with more intuitive syntax, but for now this should keep you going. Hope this helps! -- Dmitry Sotnikov http://dmitrysotnikov.wordpress.com "Kevin N. Kidder" wrote:
| ||||||||||||
| | #7 (permalink) | ||||||||||||||||||||||||
| Guest | RE: Experience with Set-QADObject for groups? I copy/pasted your line without giving it much thought. Here's a better one-liner: Get-QADGroup -SizeLimit 0 -GroupType Distribution -GroupScope Global | Set-QADObject -ObjectAttributes @{grouptype=8} It has a couple of corrections: 1. You don't need to pass $_.DN to the Set cmdlets because you already use pipeline to pass the objects. 2. You are retrieving all groups and then using where to filter the ones you need. This is inefficient because the filtering is being done on the client. Including GroupType and GroupScope into the Get-QADGroup makes the cmdlet adds these into the LDAP query and thus only the objects you need get retrieved - much more efficient! -- Dmitry Sotnikov http://dmitrysotnikov.wordpress.com "Dmitry Sotnikov" wrote:
| ||||||||||||||||||||||||
| | #9 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Experience with Set-QADObject for groups? Dmitry.. I'm a little curious... why do you pass the attribute as a hashtable? "Dmitry Sotnikov" <DSotnikovREMOVETHIS@xxxxxx> wrote in message news:98AEABB8-A840-429C-B123-A691E426130D@xxxxxx
| ||||||||||||||||||||||||||||||||||||
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| RE: Groups in BCC | sherbert | Vista mail | 0 | 2 Weeks Ago 08:34 AM |
| Contact Groups | PixelKing | Vista mail | 7 | 2 Weeks Ago 12:25 AM |
| Groups | need to know | Live Mail | 2 | 07-11-2008 02:11 PM |
| mailing to groups | Cj | Vista mail | 5 | 12-07-2007 12:43 AM |
| Groups | Pops | Vista mail | 3 | 08-19-2007 05:18 PM |