Problem:
By default Group policy service executes scripts in an elevated mode. There are some scripts like 'Map network drives' that would need to be run in UAPmode. In order to launch such scripts in a UAP context from an elevated process, you can leverage the Task scheduler API.
The logon script uses the Net use command to map network drives.It works fine for standard users, but not to domain admin users.
Additional information can be obtained from the section "Group Policy Scripts can fail due to User Account Control" from the link in part 1 of the solution.
Solution:
- Get launchApp.wsf from the MS documentation http://technet2.microsoft.com/WindowsVista/en/library/5ae8da2a-878e-48db-a3c1-4be6ac7cf7631033.mspx?mfr=true
- Created Vista_Check.vbs that isset as the login script in Group Policy.
- When I cut and pasted launchApp.wsf the formatting put an extra carriage return in part of the script that I had to remove.
Call rootFolder.RegisterTaskDefinition( _strTaskName, taskDefinition, FlagTaskCreate, _,, LogonTypeInteractive)
You didn't have to change anything in the actual login.vbs
Vista_Check.vbs==============
Dim isVista
Dim wshShell
Set wshShell = CreateObject("WScript.Shell")
GetOS
If isVista = True Then
runLaunchApp
Else
runLoginNormal
End If
Sub runLaunchApp
wshShell.Run "cscript \\
End Sub
Sub runLoginNormal
wshShell.Run \\
End Sub
Sub GetOS
strComputer = "." Set objWMIService =GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer &"\root\cimv2")
Set colOSes = objWMIService.ExecQuery("Select * fromWin32_OperatingSystem")
For Each objOS in colOSes
osCaption = objOS.Caption
If instr(osCaption, "Vista") Then
isVista = True
End If
Next
End Sub
link: http://www.developersdex.com/asp/message.asp?p=593&r=5431945&page=2
No comments:
Post a Comment