Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Experience with Set-QADObject for groups?

Closed Thread
 
Thread Tools Display Modes
Old 09-24-2007   #1 (permalink)
Kevin N. Kidder
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."

Old 09-25-2007   #2 (permalink)
Marco Shaw
Guest


 

Re: Experience with Set-QADObject for groups?

Kevin N. Kidder wrote:
Quote:

> 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!
>
Sorry, can't help, but the Quest guys usually hang out at
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
Old 09-25-2007   #3 (permalink)
Brandon Shell
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
Quote:

>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."
>
Old 09-25-2007   #4 (permalink)
Brandon Shell
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
Quote:

>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."
>
Old 09-25-2007   #5 (permalink)
Kevin N. Kidder
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
Quote:

> 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
Quote:

>>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."
>>
>
Old 09-26-2007   #6 (permalink)
Dmitry Sotnikov
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:
Quote:

> 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."
>
Old 09-26-2007   #7 (permalink)
Dmitry Sotnikov
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:
Quote:

> 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:
>
Quote:

> > 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."
> >
Old 09-26-2007   #8 (permalink)
Konstantin.Zharkov
Guest


 

RE: Experience with Set-QADObject for groups?

try to use next command:

Get-QADGroup -sl 0 -GroupType Distribution -GroupScope global |
set-qadobject -oa @{grouptype=8}
Old 09-26-2007   #9 (permalink)
Brandon Shell
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
Quote:

>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:
>
Quote:

>> 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:
>>
Quote:

>> > 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."
>> >
Closed Thread

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








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50