ITMS Administrator Group

 View Only
  • 1.  Change ownerwship on items (SQL)

    Posted Jun 18, 2018 05:59 AM

    Hi,

    Does anyone have a SQL query ready to change ownership on several items? I have found this arctile, however this looks for owners which are not present anymore. I am looking for a query where if owner = 'xxx' change to '2E1F478A-4986-4223-9D1E-B5920A63AB41' -- Symantec Administrators.

    Thanks

    Stefan



  • 2.  RE: Change ownerwship on items (SQL)

    Posted Jun 18, 2018 06:33 AM

    From the Article:

    Versions 7.5 and 7.6

    select se.OwnerGuid
    from SecurityEntity se
    left join Item i on i.Guid = se.OwnerGuid
    where i.Guid is null

    version 8.0 and later

    select se.OwnerGuid
    from SecurityEntity se
    left join Item i on i.Guid = se.OwnerGuid
    where i.Guid is null and OwnerGuid <> '0FFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF'

     

     

    If you test the SELECT first so you know it's bringing back the correct Items you wish to update,

    You should just be able to change the WHERE clause.

    OwnerGuid <> '0FFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF'

     



  • 3.  RE: Change ownerwship on items (SQL)

    Posted Jun 19, 2018 02:15 AM

    Using OwnerGuid <> '0FFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF' will change objects also which has other owners. I was thinking the same however as said I would like to only change the owner for objects with a specific owner.



  • 4.  RE: Change ownerwship on items (SQL)
    Best Answer

    Posted Jun 19, 2018 03:11 AM

    Sorry for the confusion,

    I was copying in the original SQL so you knew where to change it.

    OwnerGuid <> '0FFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF'

    i.e change to the Guid you want to amend,

    OwnerGuid = '[YOUR GUID HERE]'