Skip to main content


PowerShell split and join string

How to split a string by space using PowerShell?
PowerShell provides an easy way to do it using "split" method in PowerShell.
The split method accepts any delimiter; it can be space, dash, comma or other characters as long as it has a pattern on the string.
The split method will literally split the string and the output is displayed on a separate line or separated via a line feed.
$string = "This is my test string"
$split_string_array = $string -split " "
Output will be: This
If there is a need to remove the spaces but combine the string in one line, PowerShell also provides the "join" method which basically combine or joins the string in one line.
Example: $string = "This is my test string"
$split_string_array = $string -split " "
$join_string_array = $split_string_array -Join ""
Write-Host $join_string_array
Output: Thisismyteststring
Using the join method, a string can be manipu…

Check User SID

To check the SID for a user whose profile is not currently login using WMIC, type: wmic useraccount where (name="user007") Replace "user007" with the correct username to get the user SID.
The SID will be displayed for that particular user being queried. This will be useful if the profile for that particular user cannot be loaded or corrupted and need to identify the SID for the corrupt user profile.
Editing the registry for corrupt user profiles must edit the correct SID or else multiple issues might occur to the system.

To check the SID of a currently login user; just open a command prompt and type:
whoami /user
The command above will display the username and SID of the currently login user.
To check for FQDN (Fully Qualified Domain Name):

   whoami /fqdn
The FQDN is useful for System Administrator to check which OU (organizational unit) the user belongs to.

To check the UPN (user principal name):

   whoami /upn

UPN output will be shown like an email address, the use…

Able to ping but cannot browse in Windows

If the PC, Laptop or Server has ever worked before then it will be easier to troubleshoot.
Since it has worked before, what are the changes done to the machine?
If there are quite a few changes done to the machine, undo or remove all the changes done.
After removing or undoing all the changes, check whether web page will load or not.
If still not working, try "resetting" the browser settings.
For IE or Internet Explorer, go to "Tools", click "Internet options", click "Advanced" tab and click on "Reset" button.
Close the browser and open again, check whether the page will load or not.
If still not loading, open an elevated command prompt and do the following one by one:

To open an elevated command prompt you need administrator credentials, check out the link below on how to open an elevated command prompt.
ipconfig /flushdns

ipconfig /release

netsh winsock reset


PowerShell Get Registry Values or Entries

Navigating the registry is sometimes annoying you need to click here and there.
With the use of PowerShell life can be easier, provided you know exactly the complete registry path.
Below is a PowerShell cmdlet that will list all the software that will run automatically on the computer for all users.
Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

The PowerShell cmdlet below will list the software that will run automatically for the currently logged on user in which the command is executed.
Get-ItemProperty -Path Registry::HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Sample Output:

Akamai NetSession Interface : "C:\Users\User_007_JB\AppData\Local\Akamai\netsession_win.exe" ISUSPM: "C:\ProgramData\FLEXnet\Connect\11\ISUSPM.exe" -scheduler Sidebar: C:\Program Files\Windows Sidebar\sidebar.exe /autoRun LightScribe Control Panel: C:\Program Files\Common Files\LightScribe\LightScribeControlPanel.exe -hidden PSPath: Micros…