Solved

Copy files based on "office" property for user on AD in VBscript.

Posted on 2008-09-29
1
207 Views
Last Modified: 2012-05-05
Hi,

I'd like -using VBS - to copy some files to the desktop of users that have "London" as their Office in the Properties of their user account on the AD.

Please advise how to do this?
Many thanks
0
Comment
Question by:Alan-Yeo
1 Comment
 
LVL 70

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 22597997

Were you looking to run that as a logon script?

Getting the office is moderately straight-forward, see the snippet below.

HTH

Chris


Set objADSysInfo = CreateObject("ADSystemInfo")

Set objUser = GetObject("LDAP://" & objADSysInfo.UserName)
 

strOffice = objUser.Get("physicalDeliveryOfficeName")
 

Set objUser = Nothing

Set objADSysInfo = Nothing
 

If InStr(strOffice, "London") > 0 Then

    ' Continue on to copying file ...

End If

Open in new window

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now