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

Sunday, August 6, 2017

Installing multiple instances of Sage CRM - Tomcat & Webapps

For development reasons you may require multiple instances of Sage CRM but how duth one proceedeth , like thus


  1. Install the first instance of Sage CRM using the installer
2.   Install the 2nd Instance using the installer specifying a new instance name / directory

3. Confirm configuration file applicationHost.config in C:\Windows\System32\inetsrv\config for both instances ( check application paths and entries for both CRM instances)

4. Navigate to HKLM/SOFTWARE/Wow6432Node/eWare/Config//CRMName 
and check each CRM instance /CRMNAME and confirm details for

DatabaseTcpPort – Must be unique
Default Database, InstallDir , and database login details

5.  Check both CRM instances are listed under HKLM/SOFTWARE/Wow6432Node/eWare/Mappings in registry

6. Confirm DatabaseTcpPort being used by CRM instance is available and SQL is listening (using sql query below)

USE MASTER
GO
xp_readerrorlog 01N'Server is listening on'
GO

7.  Confirm SQL port by using SQL configuration manager




8. Check Tomcat Configuration under tomcat\webapps\crminstancename\web-inf

Db.properties or jdbc.properties

#SQL Server settings
db.driver=net.sf.log4jdbc.DriverSpy
db.url=jdbc:log4jdbc:jtds:sqlserver://MachineName-Testy:52289/Sage;language=english;instance=SQL2016
db.username=sa
db.password=&KAHKHDKJASHKD
db.dialect=com.sage.crm.core.data.sqlserver.HibernateDialect
db.connectionCustomizer=com.sage.crm.core.data.sqlserver.ConnectionCustomizer
db.defaultSqlGenerator=com.sage.crm.core.data.sqlserver.SqlGeneratorImp
db.defaultDDLGenerator=com.sage.crm.core.data.sqlserver.MSSqlDDLGenerator
db.connectiontestquery=select @@version


#Hibernate settings
db.hbm2ddl=validate

9.  Confirm each tomcat instance is running on a unique port and this port is not in use by something else
tomcat\conf\server.xml

Unique field include-----

Server port="11005" shutdown="SHUTDOWN"
<Service name="Catalina"> , (e.g catalina1 and catalina2)
<Connector port="11009" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
<Connector executor="tomcatThreadPool"
               port="11009" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
   
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

10. Check entries within IIS sdata application – URL Rewrite

 


11.  Restart IIS and Tomcat for changes to take affect
           Any issues with URL rewrite , the installer can be found CRM\Utils\EN\UrlRewriter



Wednesday, August 2, 2017

Set Up Dropbox - Blank Black Login Screen - FIX

Issue: Dropbox auto updates and it now asks you to sign in , the only issue is that the login screen is totally blank or black


Cause: This appears to be a display issue but first of all rule out the following


  • Popup blocker
  • Trusted sites internet explorer
  • Firewall / Anti-virus exceptions
  • Java / Adobe Flash (maybe :S )

Fix: For me the issue was display / graphics issue as I could blindly make my way through the setup prompts and some windows were not black other were

My fix was unusual but involved

  1. Setting resolution to 1024x768
  2. Set dropbox to use 256 bit colors (right click shortcut -> properties -> compatibility tab)
  3. Plug into your machine/server hosting dropbox with a VGA cable mouse & keyboard
When I did this everything came up as normal, I am not totally sure which part of this resolved the issue but it may have just been physically connecting to the machine with a vga cable

Other: another possible option for those running dropbox on a virtual machine would be to connect via the console/kvm or remote desktop into the machine. Even from the machine itself to itself.

Note I did try Microsoft remote desktop with the same issues so it may be worth trying a few different remote desktop clients as it appears to be a purely graphical issue, well for me anyway

Hope this helps someone , I know dropbox support is manned by one sole hamster , poor fella he's got so many emails to get through

Wednesday, July 5, 2017

Windows 10: Sysprep error Failed to remove apps for the current user: 0x80073cf2.

Why Sysprep Why...


2017-07-06 12:59:56, Error              
SYSPRP Package Microsoft.Appconnector_1.3.3.0_neutral__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.

2017-07-06 12:59:56, Error              
SYSPRP Failed to remove apps for the current user: 0x80073cf2.

2017-07-06 12:59:56, Error              
SYSPRP Exit code of RemoveAllApps thread was 0x3cf2.

Recent sysprep issue that was driving me banana's basically anytime you try and run sysprep it would stop telling me to check the setupact.log for issues, error above


Error: One or more users has packages installed under their user profile, if you receive package not found its just not found under your user profile

Resolutions:

1. The packages belong only on your profile

open up powershell

get-appxpackages | Remove-appxpackages                   (will remove all packages )

get-appxprovisionedpackages -online | Remove-appxprovisionedpackages -Online ( removes all provisioned)

if you want to be more selective you can do get-appxpackages

get-appxpackages > c:\list.txt will give you a quick output

1. Remove Users with package issues

If this is a sysprep image you most likely won't need multiple user accounts on the image. 

goto Advanced System Settings -> Advaned Tab -> User Profiles Settings 

remove unneeded profiles, only remove them if you can see the name visible if are seeing unknown profile or an un-recognizable name removing the profile will not fix your issue

3. Find out what user has the package installed

run get-appxpackages > c:\list.txt 

Open up the list and you will see for example

Microsoft.Appconnector_1.3.3.0_neutral__8wekyb3d8bbwe
PackageUserInformation : {S-1-5-21-1338954240-834293059-396468565-3684 [S-1-5-21-1338954240-834293059-396468565-3684]: 
                         Installed, S-1-5-21-1338954240-834293059-396468565-15198 
                         [S-1-5-21-1338954240-834293059-396468565-15198]: Installed, 
                         S-1-5-21-1338954240-834293059-396468565-500 [S-1-5-21-1338954240-834293059-396468565-500]: 
                         Installed, S-1-5-21-1338954240-834293059-396468565-15164 
                         [S-1-5-21-1338954240-834293059-396468565-15164]: Installed}

The package lists all SID's with offending package

Logon to DC and use AD Module for Powershell

Get-ADUser -identity

e.g "Get-ADUser -identity S-1-5-21-1338954240-834293059-396468565-15164"

this will return the username , which you can then use to login to that machine if the profile no longer exists on the machine or if the machine is still attached to the domain and you are seeing clear usernames under the user profiles simply remove the offending profile.


Good Luck & I hope that helped , until next time.. feel free to leave comments/questions

note: this is on the latest version of windows 10 pro as of 6/7/17 & I also did try get-appxpackages -allusers | remove-appxpackages but with 0% success