Kaseya Community

JKDEFRAG, How To/Best Practices for Vista User Access Control

  • Hello.

    I have been workign with JKDEFRAG for a few weeks now. I am trying to script the defrag operations, using JkDefragCmd.EXE, to occur during off-peak hours on managed PCs.

    I have it working just fine on Windows 2000 and Windows XP computers. But am having a little trouble when trying to JkDefragCmd.EXE on computers running Windows Vista - because a User Access Control (UAC) popup message is displayed, asking for permission.

    Totally disabling UAC is probably not a real option. I suppose I could turn off UAC via command line, do the required reboot, run JkDefragCmd.EXE, turn on UAC via command line, do the required reboot.

    But I thought I would post a note and see how others were handling this. Any ideas? Best Practices?

    Thanks in advance.

    Lloyd

    Legacy Forum Name: JKDEFRAG, How To/Best Practices for Vista User Access Control,
    Legacy Posted By Username: lwolf
  • Disable/enable UAC via registry.

    - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA
    - DWORD
    - 0 for disable
    - 1 for enable

    source

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: itsimpel
  • itsimpel,

    Do you know if a reboot is required in order for the change to take effect?

    Lloyd

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: lwolf
  • [QUOTE=http://www.petri.co.il/disable_uac_in_windows_vista.htm]You need to reboot the computer for changes to apply.[/QUOTE]

    So yes you need a reboot...

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: itsimpel
  • I have been searching and searching for a way to disable/enable UAC without a reboot, but I have not been able to find a way. I thought TweakUA may have been the answer, but that does nto seem to be the case.

    Any chance that someone in Kaseya-land may have found a way to accomplish this?

    Lloyd

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: lwolf
  • This might help... http://www.tweak-uac.com/programming/vista-elevator2/

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: itsimpel
  • I also want to be able to use JKDefrag during off-peak times (ie. at night). However, I can't get it to work when there is no user logged on to the computer, even though I'm telling it to run as the system user.

    How are you achieving this?

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: jedmonds
  • John,

    Are you haveing problems with computers running XP or Vista? I have not had any issues with off-hours use of JKDEFRAG with Windows XP systems. Its the UAC that seems to cause issues with the Vista systems.

    Lloyd

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: lwolf
  • Are you running the jkDefrag as system or as the user?
    We use the jkdefrag as system and it all runs fine with the Vista clients as well (all with UAC on)...or at least as far as I can tell as we've seen no failures or errors.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: rhayes@expertnetsolutions.com
  • You do not need to reboot a machine after you have disabled UAC

    Here is my script....

    Script Name: Disable UAC
    Script Description:

    IF Check Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin
    not = :0
    THEN
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center\UACDisableNotify
    Parameter 2 : 1
    Parameter 3 : REG_DWORD
    OS Type : 10
    Pause Script
    Parameter 1 : 5
    OS Type : 10
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA
    Parameter 2 : 1
    Parameter 3 : REG_DWORD
    OS Type : 10
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin
    Parameter 2 : 0
    Parameter 3 : REG_DWORD
    OS Type : 10
    Pause Script
    Parameter 1 : 5
    OS Type : 10
    ELSE

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: XeviouS
  • XeviouS,

    Thanks very much for posting your UAC Disable script.

    I actually now have my JKDEFRAG script working with UAC (bu ysing System rather than User), but I am still haev UAC problems in other scripts (such as CCLEANER).

    I have a followup question on your script. I probably shoudl cerate a seperate UAC thread, but for now, I will just continue here...

    In your script (at least as displayed in the forum), there are spaces in each line as follows:
    Step 1 - Security Center
    Step 2 - Curr entVersion
    Step 3 - Curr entVersion
    Step 3 - ConsentPromptBehaviorAd min


    I can assume that the spaces in Steps 2 and 3 were inserted by the Forum (as spaces often get added to scripts). But I am not sure about your Step1. When I look onmy Vista computer, there IS an existing key named "Security Center" and there is no key named "SecurityCenter".

    So am am wondering if there should or shoudl not be a space for the key for "Security Center"?

    Also I was wondering, I see the existing keys for \Policies\System\EnableLUA and \Policies\System\EConsentPromptBehaviorAdmin, but I did nto see an existing key for \Security Center\UACDisableNotify. Is that the correct key?

    Thanks very much, in advance.

    Lloyd

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: lwolf
  • XeviouS
    You do not need to reboot a machine after you have disabled UAC

    Here is my script....


    Works a charm, FYI this is the script I wrote to reverse the process - enable UAC:

    Script Name: Enable UAC
    Script Description:

    IF Check Registry Value
    Parameter 1 :

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin
    not = :2
    THEN
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center\UACDisableNotify
    Parameter 2 : 0
    Parameter 3 : REG_DWORD
    OS Type : 10
    Pause Script
    Parameter 1 : 5
    OS Type : 10
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA
    Parameter 2 : 1
    Parameter 3 : REG_DWORD
    OS Type : 10
    Set Registry Value
    Parameter 1 :

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin
    Parameter 2 : 2
    Parameter 3 : REG_DWORD
    OS Type : 10
    Pause Script
    Parameter 1 : 5
    OS Type : 10
    ELSE


    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: djmundy