Home

Results 1 to 4 of 4

Thread: Deleting orphaned users

  1. #1
    Join Date
    Jan 2009
    Posts
    162

    Deleting orphaned users

    Has anyone figured a way to remove users from GroupWise when their
    corresponding NDS user has already been deleted? pIADUSER->Delete(eadGW)
    returns success as does pIADUSER->Delete(eadBothNDSandGW) but in both
    cases the user is not deleted from GroupWise. I've worked though various
    possiblities without success, including recreating a user of the same
    name and context, but another limitation of the API means its not
    possible to relink them whereas ConsoleOne can.

    I have someone with several thousand such users to delete but to date
    have been unable to achieve this using the GroupWise Admin Object API.
    Has anyone achieved this?

    TIA, John
    DevSup SysOp 24


  2. #2
    torsten NNTP User

    Re: Deleting orphaned users

    John Baird schrieb:
    > Has anyone figured a way to remove users from GroupWise when their
    > corresponding NDS user has already been deleted? pIADUSER->Delete(eadGW)
    > returns success as does pIADUSER->Delete(eadBothNDSandGW) but in both
    > cases the user is not deleted from GroupWise. I've worked though various
    > possiblities without success, including recreating a user of the same
    > name and context, but another limitation of the API means its not
    > possible to relink them whereas ConsoleOne can.
    >
    > I have someone with several thousand such users to delete but to date
    > have been unable to achieve this using the GroupWise Admin Object API.
    > Has anyone achieved this?
    >
    > TIA, John
    > DevSup SysOp 24
    >

    i had the same problem


    create a temporary nds user

    foreach gw account

    replace "ngw:groupwise id" attribute (from your temporary nds user )
    with domname.poname.gwaccountname{106} gw dom id

    associate the gw account to nds account with
    addexistinguser(gwacccountname, nds user dn, "", PO, DOM, mailboxid form gw acccount);
    delete gwaccount using Delete(eadGW)


    this my perl script
    its only a sample -> it deletes users where

    username starts not with 1
    and username doesnt contain a -



    ---------------------------------

    use Win32::OLE;
    use Net::LDAP qw(:all);

    $ldap=Net::LDAP->new(" YOUR SERVER IP ") or die $@;
    $error = $ldap->bind ('cn=admin,ou=NETWORK,o=SERVER',password =>' :) ',version=>'3') or die "Fehler bei bind: $@\n";

    if( $error->error ne Success){
    die "Bind error -> " . $error->error . "\n";
    }

    $gw=Win32::OLE->new('NovellGroupWareAdmin');
    $gw->ConnectByDN("dom_bszl.groupwise.bszl.schulen");
    $objDomain=$gw->ConnectedDomain();

    $objPostOffices = $objDomain->PostOffices();
    $objPostOffice = $objPostOffices->Item("po_pupil");

    $objUsers = $objPostOffice->Users();
    $objUsersIterator = $objUsers->CreateIterator();
    print "adding tempuser\n";
    $ldap->add("cn=tempuser,o=SCHULEN",
    attr=>['objectclass'=> "inetorgperson",
    'surname' => "tempuser",
    ]
    );

    $mesg = $ldap->search(
    base=>'cn=tempuser,o=SCHULEN',
    scope => 'base',
    filter => '(objectclass=inetorgperson)'
    );


    $entry = $mesg->entry(0);

    while( $objUser = $objUsersIterator->Next() ){
    $username = $objUser->{'Name'};
    if($username !~ /^1|-/){
    $entry->replace("ngwGroupwiseID",'DOM_BSZL.po_pupil.' . $username . '{106}13F67730-0F80-0000-918F-770055005D00');
    $entry->update($ldap);

    $objUsers->AddExistingUser($username, "tempuser.SCHULEN","", "po_pupil", "DOM_BSZL", $objUser->{MailboxID});
    $objUsers = $objPostOffice->Users();
    $objUser = $objUsers->Item($username);
    print "delete $username ....\n";
    while($objUser){
    $objUser->Delete(1);
    undef $objUser;
    $objUser = $objUsers->Item($username);
    }
    print "deleted $username -> OK\n";
    }
    }

    print "deleting tempuser\n";
    $ldap->delete("cn=tempuser,o=SCHULEN");
    $ldap->unbind();



  3. #3
    Join Date
    Jan 2009
    Posts
    162

    Re: Deleting orphaned users



    torsten wrote:

    > John Baird schrieb:
    > > Has anyone figured a way to remove users from GroupWise when their
    > > corresponding NDS user has already been deleted? pIADUSER->Delete(eadGW)
    > > returns success as does pIADUSER->Delete(eadBothNDSandGW) but in both
    > > cases the user is not deleted from GroupWise. I've worked though various
    > > possiblities without success, including recreating a user of the same
    > > name and context, but another limitation of the API means its not
    > > possible to relink them whereas ConsoleOne can.
    > >
    > > I have someone with several thousand such users to delete but to date
    > > have been unable to achieve this using the GroupWise Admin Object API.
    > > Has anyone achieved this?
    > >
    > > TIA, John
    > > DevSup SysOp 24
    > >

    > i had the same problem
    >
    > create a temporary nds user
    >
    > foreach gw account
    >
    > replace "ngw:groupwise id" attribute (from your temporary nds user )
    > with domname.poname.gwaccountname{106} gw dom id
    >
    > associate the gw account to nds account with
    > addexistinguser(gwacccountname, nds user dn, "", PO, DOM, mailboxid form gw acccount);
    > delete gwaccount using Delete(eadGW)


    Torsten

    Thanks for that, I have this working. I note though that you hard coded the object ID which forms the final part of each value for "NGW:
    GroupWise ID". Do you know how to retrieve that programmatically from GroupWise? It is not the object ID of the domain, calling
    pIADDomain->get_ObjectID returns a different ID. I suspect that it is the ID for the system object but get_ObjectID is not valid for
    pIGWSystem. I can retrieve this from the "NGW: GroupWise ID" attribute of either the user's domain or post office NDS object, but can it be
    retrieve from GW itself?

    TIA, John
    DevSup SysOp 24


  4. #4
    torsten NNTP User

    Re: Deleting orphaned users

    John Baird schrieb:
    >
    > torsten wrote:
    >
    >
    >>John Baird schrieb:
    >>
    >>>Has anyone figured a way to remove users from GroupWise when their
    >>>corresponding NDS user has already been deleted? pIADUSER->Delete(eadGW)
    >>>returns success as does pIADUSER->Delete(eadBothNDSandGW) but in both
    >>>cases the user is not deleted from GroupWise. I've worked though various
    >>>possiblities without success, including recreating a user of the same
    >>>name and context, but another limitation of the API means its not
    >>>possible to relink them whereas ConsoleOne can.
    >>>
    >>>I have someone with several thousand such users to delete but to date
    >>>have been unable to achieve this using the GroupWise Admin Object API.
    >>>Has anyone achieved this?
    >>>
    >>>TIA, John
    >>>DevSup SysOp 24
    >>>

    >>
    >>i had the same problem
    >>
    >>create a temporary nds user
    >>
    >>foreach gw account
    >>
    >>replace "ngw:groupwise id" attribute (from your temporary nds user )
    >>with domname.poname.gwaccountname{106} gw dom id
    >>
    >>associate the gw account to nds account with
    >>addexistinguser(gwacccountname, nds user dn, "", PO, DOM, mailboxid form gw acccount);
    >>delete gwaccount using Delete(eadGW)

    >
    >
    > Torsten
    >
    > Thanks for that, I have this working. I note though that you hard coded the object ID which forms the final part of each value for "NGW:
    > GroupWise ID".
    > Do you know how to retrieve that programmatically from GroupWise? It is not the object ID of the domain, calling
    > pIADDomain->get_ObjectID returns a different ID. I suspect that it is the ID for the system object but get_ObjectID is not valid for
    > pIGWSystem. I can retrieve this from the "NGW: GroupWise ID" attribute of either the user's domain or post office NDS object, but can it be
    > retrieve from GW itself?
    >
    > TIA, John
    > DevSup SysOp 24
    >


    no the gw api doesnt seems to provide such a funktion :(
    at least i haven't found anything


Posting Permissions

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