Tip of the Week:Force AD Replication

Just a Quick tip for how to force replication on all Domain Controllers and all partitions. And this is by using the Repadmin tool with switch syncall. If we look at the tool, we will use the Following switches. /A Synchronizes all naming contexts that are held on the home server. /P Pushes changes outward from the specified domain controller. /d Identifies servers by distinguished name in messages. /e Synchronizes…

Read More

Tip of the Week:OS Is Licensed

So in case you want to check if Servers/Clients are licenced (Operatingsystem), you can do that via Powershell. Also you later you can use this as a Configuration Item in SCCM and deploy that in a Configuration Baseline to monitor what machines are licensed or not. This is tested on Server 2008 R2 and up.   $InstalledLicense = Get-WmiObject -Query “Select * from SoftwareLicensingProduct Where PartialProductKey IS NOT NULL AND…

Read More

Tip of the Week: $^ and $$

Let lets look more into powershell “special” characters and variables you can use. Just writing a simple output to the shell and see what we can do. Write-Host “Hello World!” -ForegroundColor Green And we see that we get an output of Hello World in Green. If we then type $^ The output is then is the fist input in the last command, in this case “Write-Host” And there is another…

Read More

Tip of the Week: $?

Never been fond of using Try and Catch. Don´t like it´s not recommended to use in scripts. Powershell has a built in variable (boolean) that holds if the last command did execute or not ($?). So inPowershell we test executing something that will nor work. and then check $? to see what happens. asdfasdf $? We see that it returned False, eg the last command did not execute. And if…

Read More

Tip of the week: Test-Netconnection

For those runing Windows Server 2012 R2/Windows 8.1 and newer. There is a built in cmdlet in powershell that combinds ping,telnet and tracert Test-NetConnection. One drawback I have is that when testing TCP-ports is that you don´t have a timeout value, and the builtin timeout value is 21 seconds, witch is the same as with Telnet. I will come back to this timeout in a later post. NB ON Server…

Read More

Tip of the week: Random Password

I’ve always been opposed to using web-based password generators, you never know if the passwords are logged in with your IP. Most often I have used my own password creation script. Recently, I discovered that you could create a password in with just two lines of code. Just let powershell call a .NET Method(). There is a .Net class called  System.Web.Security that we can load via the Assembly “System.Web” and when…

Read More