While working with address book in Lync Server, sometimes its very important and convinient to know, what exactly Lync Server have in its database regarding address book. You will need this, for example, when you working with Active Directory attributes that will be shown in contact card in Lync client.

Today's my script was written while i've been developing billing-system for Asterisk.

Every user in Active Directory has an attribute with phone number. We will take this attribute and some others into MS SQL Server to use in billing.

There are tons of scripts that can export AD users into scv-file, but none that will export users directly to SQL database. Of course we can export users into scv and then take this csv and import it into SQL database with the help of SSIS-scripts. But this method will generate two scripts, and if you have more than 5-10-15 AD domains, you will have 10-20-30 scripts, which is likely will lead to errors.

In your work in big arrays of data in Powershell, very often you will need to export data to table and after open this table in Excel. Its not recommended to code direct export from array into Excel-file, because you will need Excel installed on computer where you run the script. Also, such a code will run slowly.
So, I've decided to export data to csv-file.

When you have many WSUS-servers with central server in your organization, it might be very difficult of getting reports from computers.

Once I was needed in script to show me, at which computers I dont have approved updates installed. There is a report in WSUS console that can give me such info (it called Computer Tabular Status for Approved Updates), but I was not able to go to every WSUS-server and run this report. Its a very weird task when you have 5-10-15 of WSUS-servers.

Suddenly for me, Veeam Backup & Replication started to throw errors while backing up some of my virtual machines. As I have managed to find out, root problem was in that Veeam could not run pre-freeze script to stop some services.

Futher researches showed that UAC denied starting of scripts. When I tried to run script with elevated permissions, stop-start of services was performed without any problems.

In one of my projects, I was needed to write a script that will send SMS messages. We already had Linux server with GSM-modem that accepted commands sent by SSH. So, I was only needed to connect from Windows system to Linux with SSH protocol.

I tried to use the SSH-Session module for Powershell, but it have some issues when sending commands. So I started to work with Posh-SSH module.

As you know, Lync have its own address book (AB) that downloaded by clients. By default, the download and update process of address boook in Lync 2010/2013 triggered in first 60 minutes (random time) after program start. In our company this situation was considered as wrong, thus I had to find solution how to ensure guaranteed updating of Lync address book right after the client starts. Also, there are other issues with delta-updating of address book, like a big delays (5-10 days) after changes in Active Directory are repliacted to Lync AB.

During upgrade of domain controllers or theirs addition\removal in Active Directory domain, there is always a need to change DNS-servers in network interfaces settings in Windows. On those computers or servers where you set network settings with DHCP - there is no problems. But on those where you configure settings manually, you will have to change them manually also. It is long and inconvinient.

Sometimes you need to parse some site or big web-page. Google offers many programs and even software complexes to perform this task, but I want to show, how you can quite simply do this with the help of Powershell.

There is a Invoke-WebRequest cmdlet in Powershell, that actually parse HTML-page by tags and content. Cmdlet give you an object of page with ParsedHtml property. To this field you can apply methods to extract needed data.

As you know, there are many types of Exchange 2013 logs, and a lot of disk space is used - and - space on system disk. Theoretically, you can change paths of all logs in Powershell. But because of number of logs types in Exchange, managing all these folders (and file sizes, directory sizes, max age of files) becomes a true nightmare.

Thus I created for me and you a little memo in Powershell scripts, so I can run them after installing of next new server.

When you build your environment in Azure Cloud using IaaC (Infrastructure as a Code) approach, sometimes you will face issues during re-deployment. That's because guys from Microsoft update their VM images with new versions of software. As a result, these new images have new IDs and you must update your ARM or Powershell scripts.

Today is the great day, as I'm finally going to share my approach to monitoring of Azure Cloud resources with Zabbix. There is no built-in solution for monitoring Azure with 3rd-party software (at least, I know nothing about that), so we'll need to build our own. Before you start configuring\scripting, please make sure you're familiar with most common Zabbix features, because the task is not trivial.

Azure monitoring

Why do we need all this? Well, I've encountered a number of issues, problems and limitations while trying to use native Azure monitoring tool - OMS. Metrics could appear there with big delays, problems with writing queries, triggering problems - also is a problem.