This is a follow-up of a question I asked earlier this morning (posted here.) Following the instructions provided, I\'ve managed to query my SQL Server 2000 database for a
If you're using sqlps (SQL Powershell host) which works against SQL 2000 (I've tested this on my 2000 instance) you can use this:
$query = @"
select sid from syslogins where isntgroup = 1
AND name = 'CONTOSO\mylogin'
"@
invoke-sqlcmd -ServerInstance "myserver" -Database master -Query $query |
foreach {$SID = new-object security.principal.securityidentifier($_.SID,0); $SID.translate([system.security.principal.NTAccount]) }