CJSmith dot me

I dump stuff I find useful here

Author: Chris Smith

DBForms: Check and format email addresses from Sage Line 500/1000

Published / by Chris Smith / Leave a Comment

As the email field can sometimes not be used for the correct purpose I use a bit of code to look for an @ symbol and then a dot. If more than one email address is in I replace the comma with -t which is required by dbmailsend.
If using Sage Line 500/1000 the CustomerTable will be scheme.slcustm
I expect the DBForms def below to pickup the customer code already so there is only a lookup to the customers email address.

Remotely remove a broken user profile from another computers registry when the user folder is deleted

Published / by Chris Smith / Leave a Comment

I recently had an issue where someone had deleted my admin user profile from a remote server by deleting its folder.
The logon then failed as Windows still expected the folder to be there, as obviously the registry entries were not removed.
Rather than manually checking HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList for the SID and then removing it WMIC can be used. A user called Tommylotmanagement posted an answer and I found it worked if the user folder profile has been deleted as well.

It should then show:
Deleting instance \\<Server>\root\cimv2:Win32_UserProfile.SID=”<SID>”
Instance deletion successful

If it fails check the file c:\windows\temp\wmic.err in a text editor.

Credit: Tommylotmanagement

I have also found this has worked to correct issues where accounts keep generating TEMP or TEMP. folders.

Using current versions of Syncplify.me Server! as a Cisco UC Backup Server

Published / by Chris Smith / Leave a Comment

For anyone who has had the annoyance of trying to backup a Cisco Unity Communications based server to a Windows based server, you will know how annoying it can be.
I recommend Syncplify.me Server! and it has a how to for its older version of Server!. They have obviously changes it to a web based program in newer versions.

The new version is similar in that there is a one click setting in General Security Settings

This basically sets the server to use the SSH File Transfer Protocol Version 3

Everything else from the article applies such as the username and folder structure, so ensure you read the rest of the article from “Now that you have properly configured Syncplify.me Server! as a backup target for Cisco UCM, you have to properly configure your UCM side too”

Amend an SCCM NTFS USB flash drive for the Microsoft Surface 3 (Non Pro)

Published / by Chris Smith / Leave a Comment

Microsoft Surface 3’s for some reason don’t support mounting USB Flash drives mounted as NTFS from its UEFI/BIOS and have to be FAT32.
Either reformat the USB flash drive as Fat32 and copy back the image (Windows Command Line currently only supports FAT32 to NTFS conversion, not the other way around), third party software needs to be used to keep data in place such as Rufus. This was also recommended by the IT shared service centre where I work and worked perfectly for every Surface 3 device we had.

With a faulty drive stop Windows from mounting

Published / by Chris Smith / Leave a Comment

Credit: A Video from Linus Tech Tips reminded me of a way to stop Windows 7/10 from automounting drives

If you have an issue with a hard drive (That is spinning up, doesn’t sound like its head is craching/clicking and a SMART tool like CrystalDiskInfo Standard edition shows its healthy) that simply appears to hang your machine/take forever to mount, Windows can annoy you by attempting to mount drives. Windows can be told not to mount new drives so it can be told to not mount and forget older external drives which were plugged in.
This is useful if you want to drive and image the drive with software (If you don’t have a stand alone duplicator).

Autoscrub disable means you don’t have to modify the windows registry.
Automount scrub means you don’t have to remove the device from device manager (Often a pain with lots of external drives)

Obviously afterwards re-enable to restore default functionality

Georgia Telnet or SSH generate a list of users for GS_L_User.txt

Published / by Chris Smith / Leave a Comment

Georgia Telnet can restrict the number of users that connect to Telnet or SSH.
I am lazy so I tend to generate a list based off our user logon scripts folders, however I do of course take a backup and test it afterwards.

Additional information:
Georgia Telnet Manual and Logon Features

Creating a shortcut to a non existent location on Windows

Published / by Chris Smith / Leave a Comment

Credit: ServerFault
Credit: Craig Tolley
I came across the need to create a shortcut to a non existent file share (Where a wireless network had a different ip range on a different site). I thought Windows would let shortcuts for SMB shares be created if they didn’t exist, but Windows 10 insisted the share had to exist before being created.
ServerFault has a nice little VBS script (Although it created the shortcut, when run it didn’t close the Microsoft Script Host program. I just closed the command prompt window after)

The forum post shows it has been run on Windows 7, I have run this on Windows 10 Enterprise 64 Bit 1607 and created the shortcut on the desktop

After finding another use for the code I ran into an issue adding parameters to the shortcuts.
I wasn’t aware “Arguments” can be used, Craig Tolley has a nice post on how it is used.

Disable Word Press from allowing saving of the username and password from the login screen

Published / by Chris Smith / Leave a Comment

A plugin which isn’t in the Word Press list of available plugins is one I find very handy from Benjamin Uzelac.
It disables Word Press from allowing the browser to save the username and password and that’s it.
Its good for complying with the usual website tests, which flag saving a username and password as a high vulnerability (Like Qualys).
For some reason it states Author “Nobody” and was applied by a third party agency. The author has a file to download in the comments as well in their link below (I recommend using this ratheer than below, I just want to keep it in case it disappears).

Link: Benjamin Uzelac
Its simply create a folder in the plugin directy like “disable-login-autocomplete”, create a php file with a name like “disable-login-autocomplete.php” and copy the code from below, upload it to the plugin folder.

Use T-Sql to find triggers on specific database

Published / by Chris Smith / Leave a Comment

Credit: Joe Stefanelli on Stack Overflow

I wanted a simple way to find triggers on a specific database, Joe Stefanelli posted SQL which did exactly what I wanted.

Display the old USB Device Removal Tab

Published / by Chris Smith / Leave a Comment

Credit:
Waseemulla S on Microsoft Answers

I had a USB device that I could not unload, I prefer the old dialog box anyway and found it is still possible to show this box in Windows 10. The forum post above has the answer, however according to someone was a very poor answer. For me the answer from “Waseemulla S” worked exactly as expected, it was then I found the USB Caddy I had plugged in didn’t support stopping the USB device in this way. Waseemulla S’s steps are below (I see no need to change it)

Create a batch file that will prompt you to “Safe to remove Hardware” with just a click.
Open notepad and type

Click save as and change file type to all files, type the file name Filename.bat (Where Filename is the name of your choice)
Double click the file anytime you want to get “Safe to remove Hardware” prompt.