VB Script - almost there, get managers samaccountname?

Howdy,
I am trying to finish a script and I can't work out how to get the managers sAmAccountName for the users after running the script below.
I have pulled some of the attributes this pulls out for testing, but it does work and it populates MS SQL DB fine. I am not sure how to get the managers info aside from the DN which I can't use.
Can anyone help?
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
strBase = "<LDAP://" & "localdomain" & ">"
strFilter = "(&(objectCategory=person)(objectClass=user)(company=*))"
strAttributes = "sAMAccountName,sn,GivenName,distinguishedName,"
strAttributes = strAttributes & "Department"
strAttributes = strAttributes & "manager"
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
Set adoRecordset = CreateObject("ADODB.Recordset")
Set adoRecordset.ActiveConnection = adoConnection
adoRecordset.Properties("Page Size") = 1000
adoRecordset.Source = strQuery
adoRecordset.Open
Do Until adoRecordset.EOF
   SQLRecordset.AddNew
    SQLRecordset.Fields("sAMAccountName") = adoRecordset.Fields("sAMAccountName")
    SQLRecordset.Fields("department") = adoRecordset.Fields("department")
sDesc = ""
    If IsNull(adoRecordset.Fields("description")) = False Then
        For Each item In adoRecordset.Fields("Description").Value
               sDesc = sDesc & Trim(item)
        Next
         SQLRecordset.Fields("description") = sDesc
    Else
        SQLRecordset.Fields("description") = Null
    End If
    SQLRecordset.Fields("displayName") = adoRecordset.Fields("displayName")

Start here:
https://gallery.technet.microsoft.com/site/search?f%5B0%5D.Type=RootCategory&f%5B0%5D.Value=activedirectory&f%5B0%5D.Text=Active%20Directory&f%5B1%5D.Type=SubCategory&f%5B1%5D.Value=useraccounts&f%5B1%5D.Text=User%20Accounts
¯\_(ツ)_/¯

Similar Messages

  • Terminal Script - almost there!

    Greetings All,
    I have written the following script in order to have my clients change the Softare Update server from Apple's to the internal mirrored one I setup on OSX.
    The 2 portions that I need help with are:
    1. Removing the QUIT or RUN option (I have saved it as an application and wish to have it just run, with no choice)
    2. I'd like the terminal application to quit completely (window and all)
    The script runs correctly, but I'd like it to run automatically (like 1) and with quitting Terminal (like 2)
    Thanks in advance,
    -andy-

    >1. Removing the QUIT or RUN option (I have saved it as an application and wish to have it just run, with no choice)
    When you save the application, turn off the 'Startup Screen' option. That's what is displaying the Quit/Run dialog.
    >2. I'd like the terminal application to quit completely (window and all)
    Why are you using terminal.app at all? From the description, everything can be done with basic 'do shell script' commands, eliminating the need for terminal.app.
    Just be aware that if you do opt to use the terminal, blindly quitting it when you're done (which, BTW is done via 'tell application "Terminal" to quit') could be a very bad thing. How do you know the user didn't already have the terminal open, running a dozen different processes and logged into half a dozen other machines. Quitting the terminal just because you are done with it doesn't seem like a good idea.
    You should check the terminal.app state before you start issuing commands. Only if it wasn't running, or if it had no windows open should you consider quitting it when you're done. It might be acceptable to run your commands, close your window and quit if there are no other windows, but like I said before, you shouldn't need to use Terminal.app at all.

  • I down loaded Firefox 3.6.10, did the execution and still when load it as my browser I get a message that says "Almost there". What is going on?

    When I load Firefox as my browser, a screen comes up that wants me to download the 3.6.10 version again but, as I said, it has been downloaded, executed and I have tried this several times with the same result. I run Vista Home Premium operating system. I can still browse the internet but still get my home page as "You are almost there" or some such. What should I do?

    I have tried everything I could to fix this, but some things require actually being on Firefox, and since I cannot get on, I cannot click on the tabs to do it. I have even totally uninstalled firefox, and that has not fixed this. I still get the same message that firefox is running and I need to close it or restart (which I have also tried dozens of times). I have removed things like Java, and that has not helped either. If I cannot even get on line in firefox, how can I fix this. I am not crazy about using internet explorer, but right now, it is my only option. I even tried to start in safe mode, and the same message box pops up!

  • Is there a script that Quickly get the Equidistant and The same size images.

    Is there a script that Quickly get the Equidistant and The same size images.
    General,I used the paste into the interior one by one, when it is a lot ,will waste a lot of time

    Is there a script that Quickly get the Equidistant and The same size images.
    General,I used the paste into the interior one by one, when it is a lot ,will waste a lot of time

  • TS3408 I keep on getting this error message on my Yahoo and Safari You're almost there, but your web browser doesn't support the newest version of Yahoo! Mail

    I keep on getting this error message on my Yahoo and Safari all of a sudden;
    You're almost there, but your web browser doesn’t support the newest version of Yahoo! Mail
    The links it gives to upgrade don't work !
    I have Safari Version 5.1.7 the latest for Snow Leapord. I get the same error message on Firefox and Google Crome aI even dowmloaded another Brower for Mac still got he same error message ! I have used the Disk Utility to rparir files and rest Safari. I have deleated Firefox then downloaded a fresh version, still the same error messages ! Please help it's driving me nutts.

    Perky --
    You do not need any "Cleaner" app for Macs.  I would not be at all surprised if that didn't actually damage your Mac, especially if it were MacDefender. Applejack is OK, but I'm not sure what it erased.  Do you know?
    You also don't need any Virus Barrier.  That could also mess things up.
    The fact that all of your browsers are now messed up indicates that it is not a Safari problem, but more system-wide.
    Did you check here?
    http://help.yahoo.com/l/us/yahoo/mail/yahoomail/technical/

  • I keep on getting this error message on my Yahoo mail. You're almost there, but your web browser doesn't support the newest version of Yahoo! Mail

    I keep on getting this error message on my Yahoo mail all of a sudden;
    You're almost there, but your web browser doesn’t support the newest version of Yahoo! Mail
    The links it gives to upgrade are blocked
    I have latest version of FireFox 19 and Snow Leopard. I get the same error message on Safari and Google Crome aI even downloaded another Browser for Mac still got he same error message ! I have used the Disk Utility to repair files and rest Safari. I have deleted Firefox then downloaded a fresh version, still the same error messages ! Please help it's driving me nuts.

    You can check for problems caused by a possibly corrupted user agent.
    See:
    *https://support.mozilla.org/kb/Finding+your+Firefox+version
    *https://support.mozilla.org/kb/websites-say-firefox-outdated-or-incompatible
    *http://kb.mozillazine.org/Resetting_your_useragent_string_to_its_compiled-in_default

  • From "Almost there" when opening firefox, attempt download takes me back to "Almost there" repeatedly.

    I am unsuccessful in downloading the new 5.0.1 firefox version. I can't get past the "Almost there" screen because I download and click on the Firefox symbol to move it to the Applications folder, and when I move it from there to the Dock and open it, again, it says "Almost There." It tells me I can't perform this because I already have Firefox open, even though I have tried again and again to quit it. Do I need to delete every single vestage of firefox and start over with my bookmarks, etc. to make this work?

    A brief and probably non-helpful answer: I know of no way to eliminate your large amount of duplicates other than by repetitive, tedious manual effort.
    *There has got to be a simpler way.*
    I hope you're right, but I don't think there is a simpler way.
    BACKUP:  It also appears that the only way I can back up the catalog is to shut down LR.  Really?!
    Yes, really

  • Rmi almost there

    rmi almost there
    I did a version 1.1
    javac -tareget 1.1 ct277/*.class
    rmic -v1.1 rImp
    put everything in a jar
    compiled OK (so the class is seen in the build process)
    but on execution I got:
    Exception Details: javax.faces.el.EvaluationException
    java.lang.NoClassDefFoundError: cts77/rInterface (wrong name: rInterface)
    Possible Source of Error:
    Class Name: com.sun.faces.el.ValueBindingImpl
    File Name: ValueBindingImpl.java
    Method Name: getValue
    Line Number: 206
    Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
    Stack trace:
    com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:206)
    com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
    com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:389)
    javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1018)
    javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1045)
    javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:742)
    javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:423)
    etc etc...
    ps I posted this yesterday but it is not there now
    maybe
    1) I posted to some other forum by mistake
    2) SUN moderators removed my post because they think rmi topic is exhausted
    3) SUN moderators removed my post because they have had enough of me.
    if 2) or 3) could the moderator please email me so I dont go on posting in vain?
    cheers
    CTSkinner

    I followed the stripped down example in
    http://patriot.net/~tvalesky/easyrmi.html
    then renamed Implementation rImp
    and interface rInterface
    server rServ
    and replaced the method with a String function that returns "fred"
    - as simple as I could make it
    - it works with java Client from the command line.
    When I put all the classes in a jar, and include the jar in a Creator project, the rImplementation class is found at Build time, but causes an immediate exception at execution time
    (could there be a security problem? even though the error is ClassDef not found? I have my win2K user set at java allow all - which I hope is safe while I'm testing on 127.0.0.1)
    I put this code in a button:
    public String button1_action() {
    String serverName = "127.0.0.1";
    String cs = "ccc";
    try
    {     //bind server object to object in client
    rInterface Servo = (rInterface) Naming.lookup("rmi://"+serverName+"/rImpInst");
    cs = Servo.getSlug();
    catch(Exception e)
    cs = "Slug catch";
    // Vanilla van = new Vanilla();
    // cs = van.fudge();
    FacesContext fc = javax.faces.context.FacesContext.getCurrentInstance();
    fc.addMessage(null, new FacesMessage(cs, ""));
    return null;
    but note: the project raises exception immediately, before the button is painted
    [the commented Vanilla.fudge is an ordinary non-rmi class which displays OK if
    Servo is not defined]
    note: cts77 is the package name. I get the same error if I explicitely say
    cts77.rInterface.
    I would be happier if no packages were involved, because rmic may not understand packages.

  • Sharepoint Mailbox, Almost There

    I'm getting the following error message when I try to connect to my previously working sharepoint site mailbox:
    Almost there!
    We're not quite done setting up your site mailbox. Please check back in a few minutes. If you see this message in half an hour, contact your helpdesk.
    X-ClientId: VHGX - VHSK - YTMA - IZNGW
    X-OWA-Error: Microsoft.Exchange.Clients.Owa2.Server.Core.OwaExplicitLogonException
    X-OWA-Version: 15.0.1024.12
    X-FEServer: CO2PR06CA043
    X-BEServer: BLUPR08MB183
    Date: 9/9/2014 4:45:29 PM
    Fewer details...
    It's been like this for the last couple of days.  It was working previously and I'm not sure why it all of a sudden stopped working.

    Hi  ,
    For your issue, please take steps as below:
    1.Open SharePoint Designer.
    2.Connect to the SharePoint site where the site mailbox is stuck in provisioning.
    3.Click on the Site Options button shown in the ribbon.
    4.Locate all ExchangeTeamMailbox, there should be 4 entries.
    5.Delete the entries, remove the site mailbox from the SharePoint site if still there and try to re-create the site mailbox.
    Reference:
    http://community.office365.com/en-us/f/148/t/207174.aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Link Aggregation ... almost there!

    Hi all
    After struggling with Link Aggregation on Mac OS X Server to Extreme X450 switches we are almost there. We've now managed to get a live working link where the Ethernet 1 and 2 arew green and the Bond0 shows both links as active, and finally the Bond0 interface picks up a DHCP address.
    So that's great, but no Network connection which is weird because it got an IP address.
    Do we have to route the traffic over one of the other interfaces or something?
    Any suggestions at all?
    Cheers
    C

    Camelot wrote:
    The first, or at least - most obvious, problem is that you have IP addresses assigned to each of en0 and en1.
    This should not be the case. Only the bond0 network should have an IP address assigned.
    The other interfaces should not be configured at all. That's almost certainly the issue since your machine has three IP addresses in the same subnet - one on each of en0, en1 and bond0. It's no wonder things are confused
    Thanks that now works a treat!
    Was hoping you could help on another set of ports again being configured for Link Aggregation. We have tried to set it up in exactly the same way but again its not working. The ifconfig returns back the following:
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
    inet 127.0.0.1 netmask 0xff000000
    inet6 ::1 prefixlen 128
    gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
    stf0: flags=0 mtu 1280
    en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet6 fe80::219:e3ff:fee7:5706%en0 prefixlen 64 scopeid 0x4
    inet 169.254.102.66 netmask 0xffff0000 broadcast 169.254.255.255
    ether 00:19:e3:e7:57:07
    media: autoselect (1000baseT <full-duplex,flow-control>) status: active
    supported media: autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 10baseT/UTP <full-duplex,flow-control> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 100baseTX <full-duplex,flow-control> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control>
    en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet6 fe80::219:e3ff:fee7:5707%en1 prefixlen 64 scopeid 0x5
    inet 169.254.102.66 netmask 0xffff0000 broadcast 169.254.255.255
    ether 00:19:e3:e7:57:07
    media: autoselect (1000baseT <full-duplex,flow-control>) status: active
    supported media: autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 10baseT/UTP <full-duplex,flow-control> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 100baseTX <full-duplex,flow-control> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control>
    fw0: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 2030
    lladdr 00:1b:63:ff:fe:6e:6c:8a
    media: autoselect <full-duplex> status: inactive
    supported media: autoselect <full-duplex>
    bond0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:19:e3:e7:57:07
    media: autoselect status: inactive
    supported media: autoselect
    bond interfaces: en1 en0
    When I compared this to the working Link Aggregation ifconfig output I noticed this one has the line "media: autoselect status: inactive" as appose to active. Could this be the cause and how do I rectify it?
    Thanks

  • Almost there - Java 1-1 mapping - but no binding

    Hi
    I am trying to create a 1-1 mapping for the latest event for a service, and am able to create a new OneToOneMapping in an amendment event for the service descriptor. This generates almost the correct SQL.
    OneToOneMapping latestEventMapping = new OneToOneMapping();
    latestEventMapping.setAttributeName("latestEvent");
    latestEventMapping.setReferenceClass(ServiceHistory.class);
    latestEventMapping.dontUseIndirection();
    descriptor.addMapping(latestEventMapping);
    ExpressionBuilder builder = new ExpressionBuilder(ServiceHistory.class);
    Expression latestEventExp = builder.get("serviceId").equal(builder.get("service").get("serviceId"));
    ReportQuery subQuery = new ReportQuery(ServiceHistory.class, new ExpressionBuilder());
    Expression subQueryExp = subQuery.getExpressionBuilder().get("serviceId").equal(builder.get("serviceId"));
    subQueryExp = subQueryExp.and(subQuery.getExpressionBuilder().get("eventDate").greaterThan(builder.get("eventDate")));
    subQuery.setSelectionCriteria(subQueryExp);
    subQuery.addAttribute("serviceId");
    latestEventExp = latestEventExp.and(builder.notExists(subQuery));
    latestEventMapping.setSelectionCriteria(latestEventExp);
    This creates
    SELECT t0.EVENTDATE, t0.EVENTCONT
    ENT, t0.EVENTCOMMENTS, t0.EVENTSOURCEID, t0.EVENTTYPEID,
    t0.SERVICEID
    FROM
         SERVICEHISTORIES t0,
         SERVICES t1
    WHERE (((t0.SERVICEID = t1.SERVICEID)
    AND NOT EXISTS (
         SELECT t2.SERVICEID FROM SERVICEHISTORIES t2
         WHERE ((t2.SERVICEID = t0.SERVICEID)
         AND (t2.EVENTDATE > t0.EVENTDATE)))
    AND (t1.SERVICEID = t0.SERVICEID))
    I would expect to see this query generated once for each service object, with a binding for [serviceId = ?] As it is, the query is only called once and all services have the same latest event object reference.
    What am I doing wrong? It feels like I am almost there...
    James

    James
    Thanks for the hint - but in your example, where does SERVICE_ID come from? Is this supposed to be a qualified or unqualified database column name
    i.e. SERVICES.SERVICEID
    or is it a name of the attribute from the class behind the descriptor that owns this mapping? The only place I set the mapping's descriptors class is
    descriptor.addMapping(latestEventMapping);
    and I am worried that I have not stated that the mapping source class is Service.
    At the moment I get the error message
    Exception Description: The parameter name [serviceId] in the query's selection criteria does not match any parameter name defined in the query.
    Query: ReadObjectQuery(com.surfkitchen.skynet.central.ServiceHistory)
    I am confused because I have not defined a query, although I would expect the descriptor's source class (Service) to provide a set of parameters representing the primary key to all of its mappings.
    James

  • Report script command to get all Level 0 members of a given member

    Hi,
    Is there any Report script command to get all Level 0 members of a given member (Parent)? (very similar to @RELATIVE (mbrName, 0) in Calc Scripts).
    <DIMBOTTOM gives all the level 0 members in the dimension.
    There is a command called
    <LEAVES mbrName
    This works only for ASO.
    Is there anything similar for BSO?
    Appreciate your thoughts.
    Thanks,
    Ethan.
    Edited by: user11397030 on Dec 15, 2009 11:50 AM
    Edited by: user11397030 on Dec 15, 2009 11:51 AM

    from my blog on report scripts at
    http://glennschwartzbergs-essbase-blog.blogspot.com/2008_07_01_archive.html
    Third, there is a command to stay away from, its DimBottom. [edited] Like @CURRMBR in calc scripts, DimBottom is one of those commands that is very slow. If you use Query designer to create a report, it uses a better way. It uses the link command. In sample.basic to get all level 0 products it uses
    <Link ((<LEV("Product", 0)) AND ( <DESC("Product")))

  • Installing Firefox on netbook starts saying" you are almost there" doesn't go away after installing 3.6.12?

    I installed Firefox on my hp 2133 netbook and after installation the words "you are almost there" starts up. If I "X" it out, I can get into Firefox, and everything works fine.

    See this article for some suggestions: [[Firefox has just updated tab shows each time you start Firefox]]
    See also http://kb.mozillazine.org/Preferences_not_saved and [[Preferences are not saved]]
    * [[How to set the home page]] - Firefox supports multiple home pages separated by '|' symbols

  • I have installed grease monkey (firefox add on and it shows up at the right top)and user script, but there is no download button to download from esnips.

    Sir,
    grease monkey is an firefox add on and user scripts are there for esnips music and videos. But when i go to esnips music there is no download button as given in the tutorial. I am having the latest firefox 15.0.1.The tutorials did not work for me. There is no extra action on the user script for creating the download button. What should i do

    To get rid of Bing Search Window..............
    Click on View tab / Tools and un-check 'Search' (alias for 'Bing')

  • I have FF5.0.1 installed but you keep sending me the "you are almost there" message and I have to delete it each time

    Do not know how much more detail you need. Every time I open Firefox which is already Ver 5.0.1. What I get is the screen that says "You're almost there, but you have an old version of Firefox and need to upgrade to Ver 5.0.1. I am fed up with going thru this nonsense. I ALREADY AM USING VER 5.0.1. Sylvia Kuenemann

    See these articles for some suggestions:
    * https://support.mozilla.com/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox
    * https://support.mozilla.com/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols
    * http://kb.mozillazine.org/Preferences_not_saved

Maybe you are looking for