Hi mates,
how many times you asked to yourself : how can I delete files older than a specified date ? How can I clean a specific directory that preserve, for example, backup files from several sources ?
Quick and easy, skinny and essential.
Here below the script .....you can customize the number of days that you want preserve : older items will be deleted.
Obviously you have to customize the path too.
Powershell, automation, IT problem solving, Windows, Linux and more.......
Friday, October 23, 2015
Wednesday, October 21, 2015
Powershell report user list and their expiring date
Hi mates,
how many times you asked to yourself : how can I generate a report regarding active directory expiring users ?
I had, few months ago, the need to search in a specific OU, which users where active or not and which users have the expiration date configured.
This report was used for several purposes : check the status of interim users, consultant, partners and so on.
This report gives you a good visibility of the status of a specific set of users :
how many times you asked to yourself : how can I generate a report regarding active directory expiring users ?
I had, few months ago, the need to search in a specific OU, which users where active or not and which users have the expiration date configured.
This report was used for several purposes : check the status of interim users, consultant, partners and so on.
This report gives you a good visibility of the status of a specific set of users :
Thursday, October 15, 2015
Powershell quick clean to resigned users
Hi mates,
how many times you asked to yourself : how can I clean active directory from the group membership perspective ?
How can I clean resigned users ? few months ago we were discussing about the importance of group membership.
Sometimes the group membership could determine how many licenses I'm using for a specific product, how many sessions (Citrix for example) I'm potentially delivering to the end users.
Anyway independently of what is your usage and purpose of it, we were also discussing about to maintain "alive" (or zombified) the resigned users in a specific OU.
how many times you asked to yourself : how can I clean active directory from the group membership perspective ?
How can I clean resigned users ? few months ago we were discussing about the importance of group membership.
Sometimes the group membership could determine how many licenses I'm using for a specific product, how many sessions (Citrix for example) I'm potentially delivering to the end users.
Anyway independently of what is your usage and purpose of it, we were also discussing about to maintain "alive" (or zombified) the resigned users in a specific OU.
Powershell compare file contents
Hi mates,
how many times you asked to yourself : how can I compare file contents ?
I had some needs during the previous days....I know you too, maybe :-)
Anyway my last one was related to a complex script that should evaluate the password change of active directory users : if the user didn't change the password during the last 90 days we send him a first email. The week later another time : if the user of the first week didn't change the password yet we send him a second email, different from the first one, informing him that the week later we will disable his account. The last week another time : if the user is still persisting we lock the account.
The logic behind this script is complex enough, at least for me....I'm not a programmer.
I needed to compare several text files reporting the result of the queries done during the three weeks examined before.
I'll post this script later, during next weeks but in the meantime I would like to share some brief consideration regarding the file comparison.
how many times you asked to yourself : how can I compare file contents ?
I had some needs during the previous days....I know you too, maybe :-)
Anyway my last one was related to a complex script that should evaluate the password change of active directory users : if the user didn't change the password during the last 90 days we send him a first email. The week later another time : if the user of the first week didn't change the password yet we send him a second email, different from the first one, informing him that the week later we will disable his account. The last week another time : if the user is still persisting we lock the account.
The logic behind this script is complex enough, at least for me....I'm not a programmer.
I needed to compare several text files reporting the result of the queries done during the three weeks examined before.
I'll post this script later, during next weeks but in the meantime I would like to share some brief consideration regarding the file comparison.
Monday, September 7, 2015
Powershell delete active directory user account...a little bit better
Hi mates,
how many times you asked to yourself : how can I delete active directory users ?
How can I do it storing administrative credentials and converting the result in JSON format ?
A friend of mine asked me a simple script to should be executed in a mixed environment : Linux/PHP and Windows.
He has to delete an active directory user account having as a back result, a JSON converted string.
Additionally he asked me to capture eventual errors
Let's see what I've done....quickly :
how many times you asked to yourself : how can I delete active directory users ?
How can I do it storing administrative credentials and converting the result in JSON format ?
A friend of mine asked me a simple script to should be executed in a mixed environment : Linux/PHP and Windows.
He has to delete an active directory user account having as a back result, a JSON converted string.
Additionally he asked me to capture eventual errors
Let's see what I've done....quickly :
Friday, September 4, 2015
Import wildcard certificates on Citrix Netscaler VPX (from IIS)
Hi mates,
how many times you asked to yourself : how can I import wildcard certificates on my Citrix Netsclaer ? <br>
I had to add, to a friend's Netscaler, a wildcard certificate. The certificate request was done from an IIS (Windows 2008 R2) and then it was installed on it including the Intermediate Cert.
My Netscaler version is 10.1.
So let's try to describe briefly the steps to reach this goal :
1. Open MMC --> Add/Remove Snap-in...--> Certificates --> Computer Account. Here below you can see the certificate inside the Personal storage
how many times you asked to yourself : how can I import wildcard certificates on my Citrix Netsclaer ? <br>
I had to add, to a friend's Netscaler, a wildcard certificate. The certificate request was done from an IIS (Windows 2008 R2) and then it was installed on it including the Intermediate Cert.
My Netscaler version is 10.1.
So let's try to describe briefly the steps to reach this goal :
Export the main wildcard certficates from Windows server
1. Open MMC --> Add/Remove Snap-in...--> Certificates --> Computer Account. Here below you can see the certificate inside the Personal storage
Tuesday, September 1, 2015
Powershell verify and create a registry item
Hi mates,
how many times you asked to yourself : how can I create or check registry keys ?
I had the need to automate the check of a registry key for a customer SCCM clients.
This key was important for roadwarrior users as for internal ones.
If the key exists we have to overwrite it, if the key does not exists we have to inform our administrator about the exception triggered.
Subscribe to:
Posts (Atom)