Skip to content

Windows Server

Windows Servers Tips

Simple PowerShell Account Creation script

Recently I was inspired by the excellent Master User Creator, which we cannot use, and I had some free time, so I decided to create something simple, but still useful for my service desk guys. I ended with following script – combination of PowerShell , Mahapps and XAML. Script requires PowerShell 7, installed RSAT tools needed as well.tested on Windows 10 v20H2 and 21H2. It doesn’t work on Windows 10 v1909. I am assuming it won’t work on lower version as well.  To make it work for you change the followoing lines: Line 179 and Line 180 – Change to Correct OU Path Line 215 – your own filters what to be excluded Of course… Read More »Simple PowerShell Account Creation script

Lazy Exchange On-Premises Mailbox Creator

One of the ways to use shared mailbox with exchange is to grant “Full Access” and “Send As” access through security group. With the latest exchange security group must be universal and mail enabled. Recently I had to create bunch of mailboxes and found the process… repeating and boring, then I decided that there must be a way to automate it, since it is repeating the same thing again and again. The end result is the following script/form – what it does in short is: Creates Security Group and Mail Enable it Creates Shared Mailbox (could be done only through PowerShell) in preselected Active Directory OU – for both ,mail group and mailbox In preselected… Read More »Lazy Exchange On-Premises Mailbox Creator

Get size of all items in current path

I was looking for an easy way to get the size of all user profiles folder through PowerShell and found this woshub and inspired by it ended with the following function which measures the size of everything in current path if used without parameter. Made it a function just to be able to autoload it. It’s nothing special, however, it’s surprisingly useful 🙂 If you want folders only it will be: The only difference is Where-Object { $_ -is [io.directoryinfo] }. To switch to Megabytes replace Gb with Mb. Works with PowerShell 3/4/5/6/7.

SCCM – Change Site Code on multiple computers

If you had to change the sccm client site code on multiple computers (after sccm migration or new/upgraded server installation) nowadays you might have discovered that it’s not as easy as it should be. You could push the new site client to all computers generating a lot of heat to the network or try deprecated wmic (miserably fails). I wanted to avoid mass client push and found that the following quick and dirty script works well: First create a list of all computers using your favorite method, I already have a text file with them so I’ll just use it, it’s named mycomps.txt and it is in my current folder.

PSWriteHTML is awesome

Recently I was playing with the excellent PSWriteHTML powershell module and ended up creating a dashboard from events. Since I had a hard time going through all of the dashboard option, I’ve decided to share what I did, may be it will help someone. The example script requires PSWriteHTML module installed. Event properties I got from here, don’t know is this the original author, anyway, I wish all good to the author, whoever he is! I do not pretend this is the best code ever, however, IMHO it is doing the job right, It works out of the box, just adjust server names ($srv), taking the reboots for the last 30 days with max events… Read More »PSWriteHTML is awesome

PowerShell HTML System Report

I’ve been playing with HTML in PowerShell and ended creating not so bad script including function that creates HTML report with system info for a remote computer/server. In includes Operating System, CPU, Memory and Hard Disk, CD-Rom Info which are exported to a html file. It’s not a piece of art, have some basic error suppression, but if someone needs some info quickly it will do the job. Enjoy and leave me a comment if you need help using the script. Special thanks to Ansgar Wiechers and StackOverflow How to use: From the script folder (start powershell as admin) The entire package can be downloaded from the link below: Get-SystemReport

WSUS on secondary SCCM site

WSUS on Secondary Site   Generally speaking if everything is OK you install WSUS role with the same setup as your primary site, launch the console once, close it, install SUP from the SCCM  and configure it and that’s it. However, sometimes the WSUS breaks and when that happens it is usually a pain to get it back. These are just my two cents. Good post on SUP installation could be read here. Setting up WSUS + SUP on a Secondary Site (SCCM2012) Uninstallation TIPS: I would uninstall the WSUS and WID roles, and DELETE any resource used by WSUS. This includes: The %ProgramFiles%\Update Services folder The ~\WSUS folder tree The HKLM\Software\Microsoft\Update Services registry key. –… Read More »WSUS on secondary SCCM site

Microsoft Windows Security Audit Event Accesses IDs

I’m working on a powershell script extracting the file server audit log and creating a human readable html out of it when I got stumbled by the beautiful codes below (which are really hard to find) and decided that they deserve a re-post. Thanks to this guy for translating them. The list below is from WinXP, there are more codes in the newer windows versions, however, these are still valid. Here is the link to the TechNet post. BTW the Resource Hacker  still works and you can use it to extract the codes from %windir%\system32\msobjs.dll . Please note that you’ll have to translate them from HEX to decimal to receive the values you got from the… Read More »Microsoft Windows Security Audit Event Accesses IDs

No Internet Access Icon Windows 7/2008

Today I had to do this for an isolated network, it was a great reminder 🙂 https://social.technet.microsoft.com/Forums/windows/en-US/5a69ed0c-2fcf-483c-ab1d-ad5b16fa32ca/isolated-network-without-internet-access-how-do-i-make-the-yellow-no-internet-access-icon-go?forum=w7itpronetworking I had some missing GPO templates (2008 R2 server) which are easily obtained from Microsoft Installation is straight forward and explained under Install Instructions. And yes, you need both policies enabled.