Posts

Showing posts from February, 2017

Active Directory Password Expiration

Password expiration is a subject that troubles most helpdesk departments since users are getting locked out if they do not update their password. Today we are going to use Powershell and the ActiveDirectory module in order to create a report that will contain the information related to the passwords. The Active Directory attributes that are going to get our attention are: PasswordNeverExpires, to check if the password is set to never expire PasswordLastSet, to get the date the password was last set msDS-UserPasswordExpiryTimeComputed, to get when the password is going to expire Let's combine the above fields in order to create a report for all the users in our Active Directory: Get-ADUser -Filter * -Properties SamAccountName, ` Mail, ` PasswordNeverExpires, ` PasswordLastSet, ` msDS-UserPasswordExpiryTimeComputed | Select-Object -Prop...

Importing Scheduled Task using Powershell

Today's topic? Powershell and Scheduled Tasks! Powershell provides a much more friendlier way to interact with scheduled task using the ScheduledTask module than the sc.exe does, but lets go through the cmdlets in that module. First we have the Enable/Disable-ScheduledTask that are used in order to enable or disable a task. Then there are the Start/Stop-ScheduledTask that start or stop a task when it's running. We can use the Register/UnRegister-ScheduledTask in order to add or remove a task and Export-ScheduledTask in order to export a task to an XML file. Let me add a command that I find very useful when it comes to importing tasks from a file here: Register-ScheduledTask -Xml ( Get-Content 'C:\Temp\MyTask.xml' | Out-String ) ` -TaskName "MyTask" ` -User 'user' ` -Password 'password' – Force First we get the content of the MyTask.xml file and then we regist...

Exchange Original Client IP on IIS Logs

Image
Hi, Today I'm going to write about a project I was recently involved with that involves Microsoft Exchange server and Citrix NetScaler. One on the most common scenario when load balancing Exchange servers - and any other website as a matter of fact - is that on the web server logs, the IP of the client is not the IP of the machine that makes the requests but the IP of the load balancer instead. This is normal since the connections from the clients are terminated on the load balancer and not the web server. The load balancer opens new connections towards the web servers in order to serve the request. Lets take the following architecture for example. The connection from Client1 will be terminated on the Load Balancer and then the Load Balance will create a new connection to the Server2 server. Since the connection to the web server is initiated from the load balancer, the load balancer's IP will be the client IP as far as the web server is concerned. There are two pos...