cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
servicedesk
Champion Sweeper II
This report shows AD users without Logon Script but some users don't need to be checked.

Some user OU examples:

OU=Spain, OU=EUROPE, OU=User_Accounts, DC=mydomain, DC=net
OU=Common_Users, OU=Spain, OU=EUROPE, OU=User_Accounts, DC=mydomain, DC=net
OU=IT, OU=Spain, OU=EUROPE, OU=User_Accounts, DC=mydomain, DC=net
OU=IT, OU=TEST, OU=Spain, OU=EUROPE, OU=User_Accounts, DC=mydomain, DC=net
OU=Greece, OU=EUROPE, OU=User_Accounts, DC=mydomain, DC=net

I don't need to list the Highlighted ones but will need list only the users with OU=SPAIN


Many thanks

Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.LogonScript,
tblADusers.OU
From tblADusers
Where tblADusers.LogonScript Is Null
1 ACCEPTED SOLUTION
Daniel_B
Lansweeper Alumni
You can filter out these OU's in a report like the following example. Note: When using filters on OU's, remove the space behind each comma.

Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.LogonScript,
tblADusers.OU
From tblADusers
Where tblADusers.LogonScript Is Null And
tblADusers.OU Not In
('OU=Common_Users,OU=Spain,OU=EUROPE,OU=User_Accounts,DC=mydomain,DC=net',
'OU=IT,OU=Spain,OU=EUROPE,OU=User_Accounts,DC=mydomain,DC=net',
'OU=IT,OU=TEST,OU=Spain,OU=EUROPE,OU=User_Accounts,DC=mydomain,DC=net')

View solution in original post

1 REPLY 1
Daniel_B
Lansweeper Alumni
You can filter out these OU's in a report like the following example. Note: When using filters on OU's, remove the space behind each comma.

Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.LogonScript,
tblADusers.OU
From tblADusers
Where tblADusers.LogonScript Is Null And
tblADusers.OU Not In
('OU=Common_Users,OU=Spain,OU=EUROPE,OU=User_Accounts,DC=mydomain,DC=net',
'OU=IT,OU=Spain,OU=EUROPE,OU=User_Accounts,DC=mydomain,DC=net',
'OU=IT,OU=TEST,OU=Spain,OU=EUROPE,OU=User_Accounts,DC=mydomain,DC=net')