Search Computer Help Please

Tuesday, October 10, 2017

Windows Task Scheduler - Error 0x1 and Running SQLCMD , BATCH or VBS Script


Error/Issue: One day you wake up the sun is out you feel great but low and behold your windows scheduled tasks are no longer working. You will either get

(0x1) - For the Last Run Time

or they will run for eternity and not actually do anything.

Have had this error on windows server 2012 but not 2008 so I'm not sure what the difference is , anyway onto the FIX.

The FIX:

You will have to alter the jobs slightly to make them run again under your scheduled tasks.

example SQLCMD and VBS Script

SQLCMD


Task: To Backup all SQL Databases and dump .bak files into directory on local server

Settings:

- Run whether user is logged on or not
- Run with highest privileges

Actions

- Start a program
- Program/Script: "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE"  (or your location)
- Add arguments (optional):

-S SQLBOX\SQL2016 -d master -E -Q "EXECUTE dbo.DatabaseBackup @Databases = 'USER_DATABASES', @Directory = 'E:\BackupLocation', @BackupType = 'FULL'" -b

If your looking for the database backup procedure you can grab it at https://ola.hallengren.com



VBS Example

Task: To delete any files older than 60 days in a directory, handy for cleaning up old backups

Settings:

- Run whether user is logged on or not
- Run with highest privileges

Start a program
- Program/Script: C:\Windows\System32\cscript.exe
- Add arguments (optional): "E:\Folder\CleanOld Files.VBS"      (quotation marks needed as there are spaces)
- Start in (optional) : C:\Windows\System32\


that is it you are now up and running



Windows Server 2016 - Remote Desktop Gateway - Only One UDP Session FIX


Issue: Even when enabling UDP under transport setting in the remote desktop manager , My remote desktop gateway connections refused to use more than 1 UDP session at a time. Therefore reducing the connection speed and impacting user experience.

First Step: right click server name in remote desktop gateway manager and ensure UDP transport is enabled.

Note: Ensure you are forwarding UDP traffic from port 3391 (or what you set it to ) through your firewall from outside to inside.


The FIX:

The fix is actually very simple , for some reason even when you haven't set Group Policies relating to Remote desktop services and connections that assumes you want it off by default , which is annoying to say the least.

1. Open GPEDIT.MSC

2.  Go to Computer Configuration -> Administrative Templates -> Windows Components, Remote Desktop Services -> Remote Desktop Session Host -> Connections 

3. Select -> Select RDP Transport Protocols

4. Enable and select both UDP and TCP

for some reason when its not enabled it only gives you the one UDP session , it seems like a 2016 server glitch to me

oooooh happppy days..



Monday, October 9, 2017

Registry Regedit.exe - Access Denied even when Owner

Error / Issue: You are unable to delete a registry key even though you have full permissions and are also the owner of the key.



Fix: Use PsTools

not a conventional fix but when has that ever stopped you 

1. download PsTools / PsExec

https://docs.microsoft.com/en-us/sysinternals/downloads/psexec

2. Install / Extract PsTools

3. Open Command Prompt as administrator and navigate to pstools folder


e.g

cd C:\Users\username\Downloads\PSTools

and then run

psexec -i -d -s c:\windows\regedit.exe

or

psexec.exe -i -d -s c:\windows\regedit.exe

you now should have full access to make registry changes , hoooray willie nelson

Symantec Endpoint Cloud - Unknown Status, Subscription is Expired or Enter 13 Digit PIN

Error:
You install Symantec Endpoint Cloud or SB and get the errors Unknown Status, Subscription is Expired or are asked to enter a 13 digit PIN to activate Norton. You will also notice an event viewer for the Symantec endpoint protection service not running and timing out.



Steps to try first

1. Sign into Symantec Endpoint Manager or hosted site, enable service and check subscription on computer

2. Try a reinstall with the steps

- Remove from Programs & Features

- Run Norton Removal Tool -> https://support.norton.com/sp/en/au/home/current/solutions/v60392881_EndUserProfile_en_us

- Run Symantec Removal Tool - CEDAR -> https://support.symantec.com/en_US/article.TECH213385.html

- Manually remove directories C:\ProgramData\Norton or Symantec (responsible for activation of subscription)

- Reinstall as normal


The actual Fix

If the above does not work, right click Computer/My PC and goto properties

- Click Advanced System Settings (on left hand pane)

- Under the advanced tab click Environment Variables...

- Under Systems variables locate the "Path" variable


Click on Edit and ensure the path to your Symantec.cloud is up the very top

That is it , finally you should be able to activate and feel secure, you can force a re-activation of your product by deleting the 0000082 or 00000083 folder located in C:\ProgramData\Norton

You may find that this doesn't work also , if not you will have to do a complete uninstall and reinstall , once reinstalled immediately check the environment variables fix it up and reboot and you should be fine

hope that helps someone , was driving me absolutely bonkers trying to fix it