By default most if not all the notifications are on. To disable the Microsoft notification un check the "Suggest ways I can finish setting up my device to get the most out of Windows"
The OptionKey is a Technology blog. How to tips and useful documentation on Apple, Microsoft, Open Source Project.
Monday, June 26, 2023
How to skip the "Add a Microsoft Account" on System Startup
By default most if not all the notifications are on. To disable the Microsoft notification un check the "Suggest ways I can finish setting up my device to get the most out of Windows"
Friday, June 23, 2023
Using Powershell to Fix AD Time Drift.
Time syncing AD Controllers is an on going bane. Since I've been working as a system administrator; Active directory time sync has been a problem in most places I've been; with the system time being off by a few seconds up to 15 minutes.
I wrote a post back in 2001 about fixing AD Time drift using a registry entry for clients and servers, which has worked fine for the most part. Recently though the power was shut off in our main data center; so we shut down all our systems for the night till power was to be restored because we didn't have a UPS systems that could run for the length of the outage.
When the outage was over and I turned the servers I had one active directory controller off by 5 minutes and the other off by 7 (using my watch as the source for time). I fixed the clocks manually so they were within a few seconds of each other but wanted a better solution.
So I decided to write a powershell script to update the time. On the AD Controllers in my org W32tm is stopped and not running. So I am going to setup task scheduler to run this on a schedule that I have yet to determine. For now though I've written this script; where $TimeServer is a network time server such as time.windows.com or time.apple.com or some other ntp server or IP.
updatetime.ps1
net start W32time
W32tm /config /manualpeerlist:$TimeServer,0x8 /reliable:yes /update
w32tm.exe /config /update
W32tm /resync /force
net stop W32time
So you have to make sure powershell scripts are permitted to run.
To run the powershell script with task scheduler I use a bat file to execute it.
@ECHO OFF
powershell.exe -executionpolicy remotesigned -File $PATH/$TOSCRIPT.ps1
Now after running my powershell script on both AD Controllers they are now in perfect sync.
Sources:
https://optionkey.blogspot.com/2021/01/ad-time-drift-and-how-to-fix-it.html
Tuesday, April 25, 2023
Microsoft Family Safety
It is a free service offered by Microsoft that allows you to manage your family's devices and share information. Much like the google family link service, but is for use with all of Microsoft's services such as office, xbox game services, screen time tracking, and reporting.
What do you need to use this? All you need is an email address, it can be from any service. My wife and I both have Microsoft accounts we are using with the service and the kids have an associated Gmail account (because Chromebooks).
You will send an invite to an already active email; or you will have to create an account.
Content filters come in two sections Web and Search then Apps and Games. You can specifiy specific website to be allowed only or block specific websites. You can set age limits for games and any apps you don't want your kids to have access to.
Monday, April 24, 2023
Using PowerShell to send scheduled emails based on a php generated xml file
![]() |
| Laptop Lending Locker |
- When a laptop is borrowed with the date and time that it is due back
- an email notice 15 minutes before it is due
- an email notice if it is overdue
- an email notice when it is returned
XML File
<notices><laptopCirc><displayName>Name</displayName><barcode>2222200xxxxxxx</barcode><emailAddress>email@domain.com</emailAddress><checkOutTime>2023-04-24T10:21:00-06:00</checkOutTime><timeDue>2023-04-24T14:21:00-06:00</timeDue><laptopName>Laptop 2</laptopName></laptopCirc></notices>
The Process:
- 15 minute pre-due notice
- Notice that the laptop is due
- 15 minute overdue notice
- 15 minute pre-closing notice
- Laptop not returned the next day notice
The Scripts:
Obviously because of the locked down security model we are going to use task scheduler to run bat files to execute our powershell scripts. Our bat file must contain the $Path that goes to our powershell file. Below is a sample file.
The Bat Files:
Powershell Files:
Item Due Email Notice (SAMPLE)
Sunday, March 19, 2023
Intel Mac - Install the latest version of Windows using Bootcamp
Bootcamp formats the drive for NTFS, you can either keep your mac files or erase the whole thing install windows on the whole system disk. I deleted all partitions and installed windows on the full disk. I chose the latter because I need a full fledged windows Machine and don't need Mac OS. This will NOT affect the system's bootup. If you need to install Mac OS you will have to make a USB drive or use the cloud recovery mode.
- Wake on Lan doesn't work. We are using WOL to schedule turning on the systems and shutting them down at night. While the shutdown is still possible to do; turning the system on is a big time saver for the staff so the shutdown for the system will be disabled.
- Cloud Recovery. Since it is not possible to lockout cloud recovery it is possible for someone to erase the system and reset it to MacOS
- Ports are on the back. The ports are on the back of the imac and are accessible and can be damaged.
Wednesday, February 01, 2023
Setting up a "Guest" or "Visitor" user account on a domain on Windows 10
The requirements
To have a "guest" account on a specific system; but staff on the active directory have to be able to login and access the data they need such as mounted drives and network shares while the "guest" has access to save files to the computer and has no access to any network resources except internet. The Guest user must be setup as the default user and auto login. For making this setup I am using an administrator account, specifically a local admin account, and the computer is already attached to the domain. This computer is also going to be hooked up to a large sound system and will need to be muted on reboot as well at the end of the day if the sound had been left enabled if someone had been using it. Finally we will have to ensure that no files had been left behind; so we will need a way to delete them.
The User Account
The user account is a domain user; and therefore has to be placed in the local machine guest group for proper privileges to apply. On the active directory controller I setup a OU called Guest, I will add a GP to this later, but here we want to block inheritance, to stop any global GP from being applied which is what the ! means. The user and the computer will be placed in the Guest OU.
Auto Login
I don't want to enable a global "guest" or "visitor" account to the entire org which is why I don't have the AD Guest account enabled. So I created a user in AD called lets call them "org guest"; and on a specific computer that the org guest will be able to login to I also want it to auto login to that account for ease of use. I also need to ensure that the user is in the proper local group so they get the proper restrictions which is really quite restrictive; I don't want them to be able to access any of the organizations network resources such as any network drives. All I want them to have is the internet and the ability to copy from a USB drive to the local computer.
So to do this we are going to use regedit to make the following changes to the following registry location.
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Find the following entries we will need to edit them
AutoAdminLogon
DefaultPassword
DefaultUserName
if you don't have them we will need to make these entries and set the following values, these are all string entries and will need the following values
AutoAdminLogon and set the Value data to 1
DefaultUserName and set the Value data to $domainuser
DefaultPassword and set the Value data to $userpassword
Add the user in this case "guest" to our guest group on the local machine.
Local Users and GroupsGroup Policy
Once complete login to your AD controller and setup the following File Explorer settings under computer management. Computer Management -> Administrative Templates -> Windows Components -> File Explorer
Essentially the only settings we are changing is the hibernate power options menu and the sleep power options menu. We are going to set them to disabled.
Now the user Profile in AD requires a bit more configuration.
User Configuration -> Administrative Templates -> Windows Components -> File Explorer
We aren't going to be modifying anything in the following
- Common Open File Dialog
- Explorer Frame Pane
- Previous Versions
rm C:\Users\orgguest\AppData\local\Google\Chrome\User Data\Default -r -force
rm C:\Users\orgguest\AppData\local\Google\Microsoft\Edge\User Data\Default -r -force
rm C:\Users\orgguest\AppData\local\Mozilla\Firefox\Profiles -r -force
Fix a windows network printer that is offline
How to fix a network printer that get's installed and shows offline. By default SNMP is set to public, so when you are installing a netw...
-
When working in a test environment you don't exactly want something to have internet access; so you need to be able to download files in...
-
To see a video of the Rustdesk installation visit https://www.youtube.com/watch?v=t7UobpjDsRY and if you like the content please like and s...
-
Quick guide: Automatic login in Windows 10 Open the Registry Editor using [Windows] + [R] and “regedit” . Enter HKEY_LOCAL_MACHINE\SOF...











