Bmich71
asked on
request help obtaining the site ou on local computers using either vba or CLI interface
in multiple site domain, I need to write a login script that will identify the AD site ou that is assigned to the computer the user is signing in on.
ASKER
I have this;
Sub Determine_Site
Set oADsSysInfo = CreateObject("ADSystemInfo ")
SITE = oADsSysInfo.SiteName
Set oADsSysInfo = Nothing
End Sub
but it is not working.
Sub Determine_Site
Set oADsSysInfo = CreateObject("ADSystemInfo
SITE = oADsSysInfo.SiteName
Set oADsSysInfo = Nothing
End Sub
but it is not working.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Your code looks vaild, so there must be some other problem.
I'd look at your code that is using the variable SITE, I reckon there is a problem there.
I'd look at your code that is using the variable SITE, I reckon there is a problem there.
Hi, I have tested this:
Set oADsSysInfo = CreateObject("ADSystemInfo ")
SITE = oADsSysInfo.SiteName
Set oADsSysInfo = Nothing
MsgBox SITE
and it returns the correct site...
Rob.
Set oADsSysInfo = CreateObject("ADSystemInfo
SITE = oADsSysInfo.SiteName
Set oADsSysInfo = Nothing
MsgBox SITE
and it returns the correct site...
Rob.
ASKER
Actually the answer I got, was correct for the question I possed, but it turns out the question I possed was in the wrong area to find the solution to my problem. Thanks.
Basically you search AD for the Users Logon name, create a User Object then query the user object for its distinguished name. The you can apply the spit function using , as the seperator to build an Array.