Frank
Frank

Reputation: 11

How to check a service account is built-in network service account?

I need to check if service account in the form of (xxx\yyy$) is an built-in network service account. One way I'm thinking is compare account name with "domainName\hostname$", it's networkservice account if equals; otherwise not.

I believe there's some simple API (C/C++) can help me. Anybody know it?

Upvotes: 1

Views: 1187

Answers (1)

bmargulies
bmargulies

Reputation: 100161

You need to compare the actual SID. The sids of these well-known users are declared.

See this page at Microsoft, where you will find:

SID: S-1-5-20

Name: NT Authority

Description: Network Service

Upvotes: 2

Related Questions