Getting the path of AppData using PowerShell

Getting the path of %AppData% using PowerShell + $env: usage

There are 2 ways to find the folder location of AppData on a  PC, and to check appdata path.

The first method uses the simple $env: command. This command has long been used by C# users to make multi platform software, in the case where your AppData or any other environmental variable may be living somewhere other than the normal factory set location.

Simply open up powershell and type:

$env:APPDATA

Getting the path of %AppData% using PowerShell + $env: usage

Method 2 is basically doing the exact same as above, but this time using a call and answer approach:

Get-Childitem env:APPDATA | %{ $_.Value }

path of %AppData% using PowerShell + $env:  call

Below are some extra $env: variables that you may find useful;

Name                           Value
----                           -----
TEMP                           C:\DOCUME~1\bob\LOCALS~1\Temp
SESSIONNAME                    Console
PATHEXT                        .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PS1;.PSC1
USERDOMAIN                     WINGROUP
PROCESSOR_ARCHITECTURE         x64
SystemDrive                    C:
APPDATA                        C:\Users\bob\Application Data
windir                         C:\WINDOWS
USERPROFILE                    C:\Users\bob

 

Windows 10 release set for July 29th 2015

After a batch of updates over the weekend, Windows is now providing more info on the long awaited FREE windows 10 upgrade
Windows 10 release set for July 29th 2015

Windows 10 release set for July 29th 2015

The popups, now appearing on some windows 7 and 8 PC’s are causing quite a stir. With some people on reddit calling it both ‘intrusive’ and ‘malware-like’ 
It would appear that it is KB3035583 that installs this notification, but that requires Windows 7 SP1 or Windows 8.1 to function correctly, at the bottom of the article we have included a step by step guide in forcing this update in order to be able to reserve your own copy of Windows 10

Below, the sirst 5 screens, then taking you through to the final offer, of ‘reserving Windows 10’

win101 win103win102  Windows 10 release set for July 29th 2015 Windows 10 release set for July 29th 2015 Windows 10 release set for July 29th 2015 Windows 10 release set for July 29th 2015

If you are still looking to get a hold of the update supplying this notification then Reddit user FearGX_ explains that you can force the update to do its thing. We’ve reformatted his instructions below.

  1. Open the Control Panel, choose Administrative Tools, and then fire up the Task Scheduler.
  2. Expand Task Scheduler Library, then Microsoft, then Windows, and finally scroll down to expand Setup.
  3. Click the folder GWXTriggers and on the far right hit Run.

Again, this will only work if you’re running a legitimate copy of Windows 7 SP1 or Windows 8.1, have KB3035583 installed, and have all the latest updates.

Quick and dirty way to transfer or recover FSMO roles

Here are the basic steps you can use to transfer or recover FSMO roles during or after migration;

Without going into detail about how this process works, or what it does, If you have just migrated a new Server and are ready to make it the live master for the forrest and domain, simply open up a command prompt (CMD) and enter the following lines in one after the other;

transfer or recover FSMO roles

Ntdsutil
Roles
Connections
Connect to server *New Server Name*
Q
Seize infrastructure master
Seize naming master
(if success – continue to the below)
Seize PDC
(Server “*Server Name*” knows about 5 roles)
Seize RID master
Sieze schema master
Q

Finito. (<– dont type that!)

Why do we need to transfer FSMO Roles, or what are they anyway!?

Because an Active Directory role is not bound to a single DC, it is referred to as a Flexible Single Master Operation (FSMO) role. Currently in Windows there are five FSMO roles:

Schema master
Domain naming master
RID master
PDC emulator
Infrastructure master

And that is your FSMO roles all transferred over using simple command line. Please keep your eyes peeled for further posts looking deeper into each of the FSMO Roles,

Set server to automatically update time

If you have ever been in the situation where a time server or an old server will just not keep in sync, perhaps due to a CMOS battery error, or simply old hardware, then this cmdlet is for you.

Here is how to set a server to automatically update time;

automatically update time

Open up a command prompt and copy/paste the below:

w32tm /config /manualpeerlist:”0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org”,0x8 /syncfromflags:MANUAL
w32tm /config /update
net stop w32time
net start w32time
w32tm /resync /nowait

All that this is now doing is setting the clock to update automatically from a web time server, the servers we are using are the public pool 1, 2 and 3 at ntp.org
We stop and start the time services, and then tell it to resync with the new settings.

Windows Update stuck 3 of 3 – Can’t use PC

It would seem that the last batch of updates from Microsoft around the 12th-14th May 2015 have been causing quite a few PC’s to hang stopping at Update 3 of 3.

This so far looks like it is only affecting Windows 7 Pro X64 based PC’s

As with most IT Professionals, we would never suggest performing a Hard shut-down to your PC, unless there really is no other option, however it does look like in this case this is the only way to fix this particular ‘Stuck Update‘ issue.

If your Windows Update  stuck: windows update stuck 3 of 3

Option 1)

Press CTRL + ALT +DEL
This seems to be working for 50% of users encountering this issue, if it does not work then proceed to option 2.

Option 2)

Step 1) Hold down the power button on your PC for 10+ seconds,
Step 2) Restart PC by repressing the power button
Step 3) If confronted with a windows error ‘Your PC did not shut down normally’ screen, select “Start Windows Normally”

Out of the 7 PC’s we have now done this to, all in different environments, we are yet to see any errors or corruptions caused by this. We are continuing to look into which update specifically caused this and why, and so check back later to keep yourself updated.

 

For further reading see this Reddit thread.

Use CMD or Powershell to find last boot time

Ever wanted to check the last boot time of a PC or server?

There are multiple reasons why you may want to find out the last boot time of a server or a PC, Perhaps your server has been restarted without you knowing, and you want to be able to have a starting time to aid in your search through event logs to see what happened prior to the restart. Maybe you are remotely logged onto a PC which is running slow, but the user hasn’t restarted it for a while.

Anyhow, below is how to check the last boot time using either Powershell or CMD:

Powershell:
Get-WmiObject -class Win32_OperatingSystem | Select-Object __SERVER,@{label=’LastBootUpTime’;expression={$_.ConvertToDateTime($_.LastBootUpTime)}}

last boot time using powershell

CMD Method:

The built in systeminfo command may however be easier to remember using CMD:

systeminfo | find /i "Boot Time"

Or with the help of WMIC:

wmic os get lastbootuptime

wmicLastBoot

 

As you can see, the easiest and probably most useful quick command is by using SystemInfo, easy to remember, quick and nicely formatted.

 

Can’t use browser – Jump to URL (hh h)

Ever been stuck with a web browser so full of toolbars or extensions that its almost impossible to do anything? Is your browser unresponsive or you are unable to use the internet?
Then you need to deploy the Windows hidden Cutdown browser:

Here is how to access the web when you can’t use browser.

Simply use the following hotkeys Win+R  to open the Run box, then type “hh h” and hit enter
Cutdown web browser HH H useful can't use browser

This will bring up the ‘HTML Help’ documentation window,can't use browser

Right Click and select ‘Jump to URL’
Cutdown web browser HH H

Enter URL of site you need, in this case a copy of RKILL to help get pc back into shape,
Cutdown web browser HH H

See our List of top free products to recover your PC from a virus for more info.

 

Resolve Logmein Error 4320 (Method 2)

 

 

 

Another way to resolve Logmein Error 4320 

As discussed in my previous article on this logmein issue, this error code is most commonly found in a domain environment, or where there may be some form of user lockdown, and may even occur on a multi user non domain PC.

Basically, it is meant to protect the users PC from being accessed by someone other than the logged in user who installed logmein in the first place.

  1. First off, lets open up the logmein Control Panel (Right-Click on the logmein icon in the taskbar, or open from the start menu)
    Add users logmin
  2. Next we are going to select ‘Options’
    Add users logmin
  3. Then ‘Preferences’
    logmein properties
  4. Select the ‘Security tab’
    logmein properties
  5. Click on ‘Show Details’
    Error 4320
  6. Click on  Browse and select the correct user you want to add to allow access to the PC. You can choose from a list either by selecting the local PC name, or if you are on a domain, then the domain name that the PC is registered with.
    Logmein Error 4320
  7. Click OK to close all windows, Turn off Logmein then turn it back on,
  8. You are good to go!

 

Preventative measures could be taken however, When installing logmein, if you do so whilst logged in as a local admin for the PC, this seems to resolve the issue. Please note, this is only for the LOCAL admin for the PC, a domain admin account will most likely not work, and provide the same Logmein error 4320 as discussed above.

Resize VHD / Shrink Virtual xp Disk

So you still have something running on that Virtual XP machine silently consuming space on your HDD?
Finally decided that you need to resize VHD disks to free up wasted storage? Here is how;
Run out of space HDD

1) Turn off your VHD or close any programs that may be running  (status should be Powered down)
resize vhd for windows xp mode

2) In the Virtual Machines manager, right-click and select settings

4) Select the HDD you want to shrink and click ‘Modify’
modifying to resize vhd for windows xp mode

5) Then select ‘Compact disk’ and wait.
compacting windows xpo mode vhd disk

This process will assess how much space is currently being used, and the, remove the rest leaving 10-20% headroom for growth of the disk. It can take up to 30+ mins to complete this process, so be patient! By using this simple tool, you can shave a good 60+GB of wasted space into freely usable storage.

Resolve Logmein Error 4320 (Method 1)

How to resolve Logmein Error 4320 

Whilst setting up logmein for remote access in a pretty locked down domain environment, I have noticed that quite frequently we would get an ‘admin error 4320’ on the remote users PC.

Now the official logmein site would suggest adding users within the logmein interface, which we will cover in ‘Method 2’ however I have found a quicker workaround that works 9 out of 10 times is by simply always running the program as administrator.

  1. Place the Logmein icon either on your desktop or navigate to the program folder path usually “C:\Program Files (x86)\LogMeIn Ignition”
  2. Right click on the icon and select ‘Properties
  3. Once in Properties select the ‘Compatibility’ tab at the top
  4. At the bottom under ‘Privilege level’ tick the ‘Run this program as Administrator’ box*.
    How do I resolve Error 4320
  5. If you have more than 1 user on the PC, select ‘Change settings for all users’
  6. Again tick the ‘Run this program as Administrator’ box
    Logmein Error 4320
  7. OK out of both windows, If logmein is running. Close it again and re-open it, now using an Administrative logon.

Your Logmein error 4320 should now be resolved. if not see the link below

Logmein Error 4320 Method 2

*If the ‘Privilege level’ box is greyed out, be sure that you are logged on as an administrative user, or log off and back on as one in order to continue.