July 18, 2018 at 12:04 pm
reza.azimi - Wednesday, July 18, 2018 12:03 PMSolomon Rutzky - Wednesday, July 18, 2018 12:02 PMreza.azimi - Wednesday, July 18, 2018 11:55 AMI have tried to use your function - BintoSIDstring but I wonder why do I see the same SID value all the time?this is my query:
SELECT top(900) SUSER_SID(), mds.dbo.fn_SIDToString( SUSER_SID()) as Login_SID, *
FROM OpenQuery (ADSI,
'SELECT title, objectsid, sAMAccountName, givenname
FROM ''LDAP://dansk-retursystem.dk''
WHERE objectClass = ''User''
') as tblADuserYou are passing in "SUSER_SID()", which is the SID of the current user who is executing that statement. That value is not going to change per row.
Take care,
Solomon..okay so how do I tell it to take the suser_sid for each row?
or what I actually want is of course to return the SID for those users I have in focus from ADSI.
July 18, 2018 at 12:10 pm
reza.azimi - Wednesday, July 18, 2018 12:04 PMreza.azimi - Wednesday, July 18, 2018 12:03 PMSolomon Rutzky - Wednesday, July 18, 2018 12:02 PMreza.azimi - Wednesday, July 18, 2018 11:55 AMI have tried to use your function - BintoSIDstring but I wonder why do I see the same SID value all the time?this is my query:
SELECT top(900) SUSER_SID(), mds.dbo.fn_SIDToString( SUSER_SID()) as Login_SID, *
FROM OpenQuery (ADSI,
'SELECT title, objectsid, sAMAccountName, givenname
FROM ''LDAP://dansk-retursystem.dk''
WHERE objectClass = ''User''
') as tblADuserYou are passing in "SUSER_SID()", which is the SID of the current user who is executing that statement. That value is not going to change per row.
Take care,
Solomon..okay so how do I tell it to take the suser_sid for each row?
or what I actually want is of course to return the SID for those users I have in focus from ADSI.
I assume you would pass in "tblADuser.objectsid" to that function....
SQL# — https://SQLsharp.com/ ( SQLCLR library ofover 340 Functions and Procedures)
Sql Quantum Lift — https://SqlQuantumLift.com/ ( company )
Sql Quantum Leap — https://SqlQuantumLeap.com/ ( blog )
Info sites — Collations • Module Signing • SQLCLR
Viewing 2 posts - 16 through 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy