Archive for the ‘ OS ’ Category

Backup / Restore startmenu design (Layout)

If you want to backup your startmenu layout you can export using:

1
export-startlayout –path C:\layout.xml

BUT,You can import a Start Menu layout using Group Policy Editor (gpedit). After importing the layout it will be fixed, that is you will not be able to change that layout by moving the tiles around.

or better yet copy it as below.

 

backup:

Files are saved in the location of the script.

1
2
Reg export ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount") ("backup_startmenu.reg") /y
Copy-Item ("$env:LOCALAPPDATA\Microsoft\Windows\Shell\DefaultLayouts.xml") -Destination ("backup_startmenu.xml")

 

restore:

1
2
3
Reg delete ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount") /f
Reg import ("backup_startmenu.reg")
Copy-Item ("backup_startmenu.xml") -Destination ("$env:LOCALAPPDATA\Microsoft\Windows\Shell\DefaultLayouts.xml")

 

All in one menu and options (save as anything.ps1)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#------------------------------------------------------------------------------
# AUTHOR(s):
# Kyle Wadman
# 12/2019
# -----------------------------------------------------------------------------
CLS
$Loop = $true
While ($Loop)
{
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Start | PowerShell Script menu
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CLS
write-host
write-host +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
write-host "Startmenu backup/restore | -V1.0 Windows 10"
write-host +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
write-host
write-host -ForegroundColor yellow "Your can use the export-startlayout command to complete this task but on importing back into the system,"
write-host -ForegroundColor yellow "your startmenu will be fixed to the exported design. This method doesn't restricted changes after."
write-host
write-host 'PLEASE SELECT AN OPTION '
write-host -ForegroundColor gray '------------------------------------------------'
write-host -ForegroundColor green 'B) BACKUP'
write-host -ForegroundColor gray '------------------------------------------------'
write-host -ForegroundColor cyan 'R) RESTORE'
write-host -ForegroundColor gray '------------------------------------------------'
write-host -ForegroundColor yellow 'X) Exit'
write-host

$opt = Read-Host "Select an option "
write-host $opt
switch ($opt)
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# End of | PowerShell Script menu
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

{
b { #BACKUP SCRIPT
CLS
write-host "Exporting Reg >"; Reg export ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount") ("backup_startmenu.reg") /y
write-host "Collect XML >"; try{Copy-Item ("$env:LOCALAPPDATA\Microsoft\Windows\Shell\DefaultLayouts.xml") -Destination ("backup_startmenu.xml")} #-ErrorAction SilentyContinue
catch{write-host "Failed to find XML"; pause; break}; write-host "The operation completed successfully."
write-host -BackgroundColor yellow -ForegroundColor red " All Done "
pause
}

r { #RESTORE SCRIPT
CLS
write-host "Clean reg >"; Reg delete ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount") /f
write-host "Import reg >"; Reg import ("backup_startmenu.reg")
write-host "Place XML >"; try{Copy-Item ("backup_startmenu.xml") -Destination ("$env:LOCALAPPDATA\Microsoft\Windows\Shell\DefaultLayouts.xml")}
catch{write-host "Failed to Place XML"; pause; break}; write-host "The operation completed successfully."

write-host -BackgroundColor yellow -ForegroundColor red " You now need to logout and back in to see the results. "
pause
}

x{#BYE
CLS
write-host "Goodbye, It was nice to see you today."
exit
}

}
}

 

I did find someone has built this process into an application here.  For coded requirements, you can thank me later.

Maybe for personal backups, check out the software version.

Print Friendly, PDF & Email

WMindows 10 Profile backup

It’s been a while and this is shortly explained but the following script is designed to backup a users profile in windows 10 (1903) but should work on all Windows 10.

Line 149: $var_backupRoot needs to be updated to a backup ROOT location.

Download File

 

 

 

 

 

 

 

 

Print Friendly, PDF & Email

Windows 10 “Just a Moment”

So I started my Windows 10 Golden image on 1607.  I upgraded to 1703 and then after deployment to the machine it gets stuck on “just a moment”.

Add the following to your unattended and all will be right with the world once more.

<OOBE>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<SkipMachineOOBE>true</SkipMachineOOBE>
<SkipUserOOBE>true</SkipUserOOBE>
</OOBE>

For more detail please see source

Print Friendly, PDF & Email

XenServer – Change DNS Server IP

If you want to change the config of the nameservers in xenserver you can just edit this file.


1) login to xenserver via SSH or console

2) Type "nano /etc/resolv.conf"

3) Make changes

4) Press Crtl+W to write (Y to confirm)

5) Press Ctrl+X to exit.

Print Friendly, PDF & Email

Specify directory with spaces in /etc/fstab

If you want to add a filesystem to mount in /etc/fstab you need to use the octal ASCII value which is \040. In my case I have created a separate filesystem for VMware virtual machines:

/dev/mapper/vmwarefs  /var/lib/vmware/Virtual\040Machines ext3 defaults 1 1

If you have any other special characters which are causing problems you can check with

man ascii

for the value you need to specify.

Print Friendly, PDF & Email

Windows 7, kick logged on users like XP did

This little program allows any user of the local admin group to log off a user who has locked their machine, just like in windows XP without using fast user switching. It basically takes seconds to install and when a user locks their machine, they get the message stating that user x has locked this machine … “This computer is locked. Only the logged on user can unlock the computer” and to unlock it you need to press control, alt, del and log in with the users details who have locked the machine.

 

Download Application & Code

Source site: View forum post

 

Print Friendly, PDF & Email

mount samba share on MAC desktop

Locate apple script on your system under utilities.  Create a new document and do one of the two below actions.

 

tell application "finder"
map volume "smb://servername/servershare"
end tell

OR with username and password

tell application "Finder"
mount volume "smb://WORKGROUP;username:password@servername/servershare"
end tell

Save the file, I change it from a script to an application so I can still edit it, but i can just double click it to use it.

If you want this to work automatically, add the script to the user account startup options found in the account settings in settings.

 

Other apple commands, good read 😉

http://www.tuaw.com/2007/12/29/applescript-finder-commands/

Print Friendly, PDF & Email

Lost MAC password

So someone asked me to access their MAC to which they added they had lost the password and didn’t have any OSX disks.  Difficult I thought, BUT no, EASY !

So this manual doesn’t change or retrieve the lost password. but does allow you to create another administrator account on the MAC. Once your in as a new administrator you can get your data back or just to into account and change the password for the original account.

1) Boot your MAC from off (not sleep) and hold the “command” key and the “S” key at the same time.

2) Once at the prompt root# let go and type the following:

mount -uw /

rm /var/db/.AppleSetupDone
shutdown -h now

4) the MAC will reboot and you will do the welcome setup (where you create a new account)

5) login as that new user and then change the account password for the locked account in settings.

6) Clean up by logging in as your unlocked your and delete the temp admin account we just created in the MAC settings.

Please try and add a note to confirm.

Print Friendly, PDF & Email

Check Windows 7 Activation Using VBS

So i had some issues trying to use windows activation and wanted to be able to report on the OS status using BGInfo.

My below script can be referenced  inside BGInfo.

I might be worth downloading WMI Code Creator v1.0 This can be used to show what other information is ready for the picking.

Editing the below script will be able to report on any of the records WMI can throw your way.

 

Copy and paste the following code into a new .vbs file


Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From SoftwareLicensingProduct")
Coltest = int(0)
IsWinActivated = True

For Each objitem In colItems
IF int(objitem.GracePeriodRemaining) = 0 Then Coltest = True else Coltest = False
IF Coltest = False then IsWinActivated = False
Next

IF IsWinActivated = False then
call echo "Failed"
ELSE
call echo "Successful"
END IF

Print Friendly, PDF & Email

Bring laptop in for maintenance (Build for windows 7 32/64)

Please Explain…

OK, So at work I was asked to devise a way to make users return their laptops to us in IT for maintenance reviews. Now if anyone else has tried to get users to return hardware of maintenance on their own, it’s impossible…

So I have created a script that disables user logins after a X number of days. They also receive warnings after a different X number of days.  In my environment the PC’s are not connected to the domain. they run Windows7 32-bit.

I would like to know if I could get this to work on a domain system, but I’m going to say no for now.. No user to lockout, but you could amend to corrupt some type of file.

Basicly, I have created a services that runs a script to check the current date is not grater than or equal to the date of lockout. The script then locks specific user accounts if the date is grater than or equal to today’s date. If it’s not grater than or equal to today’s date then it checks if the notify period is grater than or equal to today’s date. Again, if this is grater than or equal to today’s date it will start to display messages to the user. The background login wallpaper will also change to a warning. Once the lockout date as been reached or passed, the lockout action is committed and the users cannot login. The wallpaper on the login screen changes to access denied. Now the only user who can use the computer is the local administrator account.

So now they bring the PC back to you because it’s now useless to them in it’s current state. When you login it runs the notify.bat as it does when any user logs in, but instead or it’s normal action of displaying a pop-up message, it will reset the restriction an set the schedule back to X days in the future. This is because you logged in as administrator, not because you are an administrator of the PC.

This service will lock administrator accounts as well, it just works on username. So even if the user is a local admin, this will still work. Although they could go into the Win7Checker folder and edit the dates so to stop lockout. So a normal user account for users is best. The service runs as an administrator so can make changes that the current your can’t make.

There is also a grace of one extra login after expiry. this is to allow access if the PC have been off for months. It also allows updates of the wallpaper to take place.

Install Instructions…. — DOWNLOAD SOFTWARE

1. Download

2. Extract files to a temp folder

3. Run install.bat as an administrator user with elevated privileges.

NOTE: When installing on x64 OS take the (x86) off the Program files on install of the RKTools.exe


5. Navigate to the folder "c:\windows\system32\Win7Checker\"

6. Right Click run.bat and click properties

7. Under the General Tab, Click Unlock

8. Repeat steps 6 & 7 for notify.bat & doff.exe in the same folder.

9. Reboot And COMPLETE

10. Use the .psd (Adobe Photoshop 3 document) to create your own JPG messages..

NOTE: the JPG files have to be less than 256kb in size otherwise windows will not use it.

Files Explained…

Below is a basic idea of what each files does.

BackgroundDefault.jpg - Normal background wallpaper.

BackgroundDefault2.jpg - Warning Wallpaper.

BackgroundDefault3.jpg - Access Denied Wallpaper.

doff.exe - Required for processing the dates.

notify.bat - Display messages. Admin user login does a reset.

run.bat - service run script. Main processing script

date.txt - This holds the date of expiry

notify.txt - This holds the date of starting to notify user.

today.txt - This holds the current date for processing.

bginfo.txt - This holds a readable date of expiry, I use BGInfo to put this on the desktop wallpaper.
Print Friendly, PDF & Email