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 MoreTip 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 MoreScript: Test TCP port
The are many ways to test to see if a TCP port is open on another server. Some people use Telnet and some use Powershell cmdlets. Telnet Pros: Legacy application and will work on older version of windows. Telnet Cons: Telnet is not installed by default, and you must enable this feature. When you get a connection, most of the times you must close the prompt and start a…
Read MoreTip 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 MoreTip 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 MoreTip 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