diff --git a/src/port/win32security.c b/src/port/win32security.c
index ab9cd67..cfa0aec 100644
--- a/src/port/win32security.c
+++ b/src/port/win32security.c
@@ -218,7 +218,8 @@ pgwin32_is_service(void)
 	_is_service = 0;
 	for (x = 0; x < Groups->GroupCount; x++)
 	{
-		if (EqualSid(ServiceSid, Groups->Groups[x].Sid))
+		if (EqualSid(ServiceSid, Groups->Groups[x].Sid) &&
+			(Groups->Groups[x].Attributes & SE_GROUP_ENABLED))
 		{
 			_is_service = 1;
 			break;
