Search found 14133 matches

by jvierra
Mon Sep 08, 2008 4:57 am
Forum: VBScript
Topic: list a users group memberships
Replies: 1
Views: 989

list a users group memberships

Thanks Alexander. Here is a link to the solution code for the LDAP/ADSI solution to this request. http://www.scriptinganswers.com/forum2/forum_posts.asp?TID=2237&PID=11754#11754 Here is the code. distinguishedName = "cn=John Smith,ou=Developers,dc=mydomain,dc=com Set objUser = GetObject("LDAP://" & ...
by jvierra
Mon Sep 08, 2008 4:21 am
Forum: VBScript
Topic: Formatting VBscript text output?
Replies: 3
Views: 3519

Formatting VBscript text output?

Hi jclegg Your coed is VBA or VB and will not work in WSH/VBScript. Streamwriter is not available to scripting languages. Here is a link to the vbscript/WSH documentation. Yuo shoould review it to see what works and what doesn't work as most of the VB syntax is modified when using vbscript. http://w...
by jvierra
Sun Sep 07, 2008 11:04 pm
Forum: VBScript
Topic: VBScript to get info from Active Directory
Replies: 2
Views: 826

VBScript to get info from Active Directory



This gets the curretn users info directly, resolves the aDSPath-DN and returns the mail address.

Code: Select all

	
Set objSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objSysInfo.UserName)
WScript.Echo "Email: " & objUser.Get("mail")

	

	
jvierra2008-09-08 06:07:59
by jvierra
Thu Sep 04, 2008 5:46 am
Forum: VBScript
Topic: Pulling Multiple Account Atts
Replies: 3
Views: 1210

Pulling Multiple Account Atts

Spelling:
objFile.WriteLine objRecordSet.Fields("sAMAccountName").Value & "," & objRecordSet.Fileds("ExtensionAttribute9").value

Be sure On Error is commented out or removed.

The typo was mine in teh example - sorry.
jvierra2008-09-04 12:49:20
by jvierra
Thu Sep 04, 2008 5:33 am
Forum: VBScript
Topic: Pulling Multiple Account Atts
Replies: 3
Views: 1210

Pulling Multiple Account Atts

Here is a working example Const ADS_SCOPE_SUBTREE = 2 Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Open "Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand....
by jvierra
Wed Sep 03, 2008 11:47 pm
Forum: VBScript
Topic: Formatting VBscript text output?
Replies: 3
Views: 3519

Formatting VBscript text output?

Are you trying to format the mail mesage body or the log file? If you aretrying to format the mail message then using either PowerSHell or VBScript you will need to assign the txt to the Message.HTMLBody property. The "TextBody " property is just for plain text. Normally both are assigned. The text ...
by jvierra
Wed Sep 03, 2008 4:33 am
Forum: VBScript
Topic: Add runas to command shell on any file
Replies: 7
Views: 2361

Add runas to command shell on any file

I kept thinking it was some kind of special switch like "directory service" "domain system" or "don't screamit"

Got me on that one.
by jvierra
Mon Sep 01, 2008 12:48 am
Forum: Windows PowerShell
Topic: How do I get a Powershell script to set Wallpaper?
Replies: 8
Views: 15956

How do I get a Powershell script to set Wallpaper?

It is teh "cat's pajamas" of scripting in teh Windows World. I understand that Apple and Unix are negotiating for license rights. The full movie should be coming out in June. Stay tuned. I left the timeout as an excercise for you. The method is not really related to Powerhell but is a technique that...
by jvierra
Mon Sep 01, 2008 12:31 am
Forum: Windows PowerShell
Topic: How do I get a Powershell script to set Wallpaper?
Replies: 8
Views: 15956

How do I get a Powershell script to set Wallpaper?

For fun here is a solution:



uploads/2491/SetWallpaper.txt
by jvierra
Mon Sep 01, 2008 12:06 am
Forum: Windows PowerShell
Topic: How do I get a Powershell script to set Wallpaper?
Replies: 8
Views: 15956

How do I get a Powershell script to set Wallpaper?

This sets thet wallpaper value:

Code: Select all

	
set-itemproperty -path "HKCU:Control PanelDesktop" -name WallPaper -value Zapotec.bmp