Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
Active Directory
Query AD Sites and Services
Last Post 07 Feb 2012 12:03 PM by
Geoff Guynn
. 1 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
Adoyt
New Member
Posts:21
07 Feb 2012 11:07 AM
Hi,
I have a request to log the site that users log into. I figure the easiest way to do this is through a logon script. Since I don't want to install the AD ps cmdlets or Quest tools on every machine, will it be easier to just call .NET?
Geoff Guynn
Basic Member
Posts:139
07 Feb 2012 12:03 PM
You might not even have to do that. If the computer is also in the site that the user is logging in to. You can use this one line to get the site name.
(It is using .Net, but not doing any real heavy lifting in Active Directory.)
[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Active Directory
--Exchange Server
--Lync Server
--SharePoint
--SQL Server
--System Center
--Non-Microsoft Products
--Books, Tools, and Videos
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
Active Directory
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2