Beranda > Script > Script get user informasi dari Active Directory

Script get user informasi dari Active Directory

Script dibawah ini adalah untuk mendapatkan inforamsi dari user yang ada di active directory. Caranya buka notepad atau editor lain, copy paste script ini dan save jadi *.vbs, kemudian jalankan deh, nanti hasilnya ada di C:\ (atau bisa dirubah sesukanya, yang penting punya akses ke lokasinya)

—-BEGIND SCRIPT—

Const ADS_SCOPE_SUBTREE = 2

Set objCon = CreateObject(“ADODB.Connection”)
Set objCom = CreateObject(“ADODB.Command”)
objCon.Provider = “ADsDSOObject”
objCon.Open “Active Directory Provider”
Set objCom.ActiveConnection = objCon

objCom.Properties(“Page Size”) = 1000
objCom.Properties(“Searchscope”) = ADS_SCOPE_SUBTREE

Set objFso = CreateObject(“Scripting.FileSystemObject”)
OutFile = “C:\UsersInfo.txt”
If objfso.FileExists (OutFile) Then objfso.DeleteFile (OutFile)

Sub subWrite(strMsg)
Set txtWrite = objfso.OpenTextFile (OutFile,8,True)
txtWrite.WriteLine strMsg
txtWrite.Close
End Sub

objCom.CommandText = _
“SELECT distinguishedName, physicalDeliveryOfficeName, company, title, department, displayName, sn, givenName, sAMAccountName, cn  FROM ‘LDAP://OU=Users,OU=Company,DC=contoh,DC=com'” & _
“WHERE objectCategory=’user’ AND sAMAccountName=’Nana Sutisna'”

Set objRec = objCom.Execute

subWrite “sAMAccountName: ” & objRec.Fields(“sAMAccountName”)

subWrite “givenName: ” & objRec.Fields(“givenName”)

subWrite “sn: ” & objRec.Fields(“sn”)

subWrite “displayName: ” & objRec.Fields(“displayName”)

subWrite “department: ” & objRec.Fields(“department”)

subWrite “title: ” & objRec.Fields(“title”)

subWrite “company: ” & objRec.Fields(“company”)

subWrite “physicalDeliveryOfficeName: ” & objRec.Fields(“physicalDeliveryOfficeName”)

subWrite “cn: ” & objRec.Fields(“cn”)

subWrite “distinguishedName: ” & objRec.Fields(“distinguishedName”)

MsgBox “Get user info completed”,,”Information”\

—END SCRIPT—

Semoga bermanfaat,

Nana Sutisna

Iklan
Kategori:Script
  1. buy Xanax
    Januari 5, 2013 pukul 12:05 pm

    I’m really impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you customize it yourself? Either way keep up the excellent quality writing, it is rare to see a great blog like this one nowadays.

  2. Januari 16, 2013 pukul 7:20 am

    I used to be recommended this web site by way of my cousin.
    I’m not certain whether this post is written by means of him as no one else realize such precise approximately my difficulty. You are wonderful! Thanks!

  3. April 9, 2013 pukul 7:21 pm

    I absolutely love your blog and find a lot of your post’s to be what precisely I’m looking for.

    can you offer guest writers to write content for yourself?
    I wouldn’t mind creating a post or elaborating on most of the subjects you write about here. Again, awesome web site!

  4. April 10, 2013 pukul 11:11 am

    Your style is really unique compared to other folks I have
    read stuff from. Thank you for posting when you’ve got the opportunity, Guess I will just bookmark this blog.

  5. April 17, 2013 pukul 6:12 pm

    I feel this is one of the most vital info for me.
    And i am happy studying your article. But should statement on some
    common issues, The website style is perfect, the articles is in
    point of fact great : D. Just right activity, cheers

  6. April 22, 2013 pukul 8:23 am

    Your post has confirmed beneficial to me. It’s extremely useful and you really are obviously extremely
    knowledgeable in this area. You have opened our eyes
    for you to numerous views on this specific subject matter using intriguing,
    notable and strong content material.

  7. April 25, 2013 pukul 6:43 am

    I do believe all of the ideas you’ve presented in your post. They are really convincing and will certainly work. Nonetheless, the posts are too brief for novices. Could you please lengthen them a little from subsequent time? Thank you for the post.

  8. Mei 6, 2013 pukul 8:49 pm

    I drop a leave a response each time I like a post
    on a website or I have something to add to the conversation.
    It is triggered by the fire displayed in the post I looked at.

    And after this post Script get user informasi dari Active Directory | Errorguide’s Blog. I was actually moved enough to drop a thought 🙂 I actually do have a couple of questions for you if you tend not to mind. Could it be only me or does it appear like some of these comments appear like they are left by brain dead individuals? 😛 And, if you are posting at additional online social sites, I would like to keep up with you. Could you make a list all of your communal sites like your linkedin profile, Facebook page or twitter feed?

  9. Juli 4, 2013 pukul 1:00 pm

    Hey There. I found your weblog the usage
    of msn. This is a very well written article. I’ll make sure to bookmark it and return to read more of your useful information. Thank you for the post. I’ll
    definitely return.

  10. Juli 5, 2013 pukul 12:20 pm

    Generally I do not learn article on blogs, however I wish to say
    that this write-up very pressured me to check out and do it!
    Your writing taste has been amazed me. Thanks, quite
    nice post.

  11. Juli 9, 2013 pukul 11:03 pm

    Hurrah! In the end I got a web site from where I know how to in fact
    take helpful data regarding my study and knowledge.

  12. Juli 10, 2013 pukul 9:36 pm

    Hi, just wanted to mention, I liked this post. It was helpful.

    Keep on posting!

  13. Juli 25, 2013 pukul 4:03 pm

    If you follow dieting questionnaire the diet and it is a useful food, and tasty vegan recipes.
    A week from today I will report my weight loss week starts from there.
    The one thing about adverts for diets on TV or in Magazines, is that
    Dieting Questionnaire and eating clean is hard.
    A perfect weight loss diet contains a brilliant combination of fruits, green vegetables and orange.
    Being active when trying to conceive and throughout the pregnancy is a
    good way forward.

  14. Agustus 4, 2013 pukul 3:38 am

    excellent post, very informative. I’m wondering why the opposite experts of this sector don’t understand this.
    You should proceed your writing. I am confident, you’ve a huge readers’ base already!

  15. Agustus 7, 2013 pukul 5:21 pm

    This is really interesting, You are a very skilled blogger.
    I have joined your rss feed and look forward to seeking more of your excellent post.
    Also, I have shared your web site in my social networks!

  16. November 14, 2013 pukul 4:31 am

    Your mode of explaining all in this post is really pleasant, all be able to effortlessly be aware of it, Thanks a lot.

  17. November 21, 2013 pukul 3:07 am

    This design is steller! You obviously know how
    to keep a reader entertained. Between your wit
    and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Wonderful job.
    I really loved what you had to say, and more than that, how you presented it.

    Too cool!

  18. Desember 4, 2013 pukul 5:07 am

    If you would like to take a good deal from this piece of writing then you have to apply these
    strategies to your won website.

  1. Januari 11, 2011 pukul 3:12 pm
  2. Juni 10, 2011 pukul 10:05 am

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

%d blogger menyukai ini: