You can do really really cool stuff with gpos in vbScript. I will show you how to export reports and give you some examples what else can be done going the vbScript way… The Group Policy Management console in Windows offers you the possibility to export reports about group policy object’s settings to html files – this, for example, is an excerpt of my default domain controllers policy: You can do this (and much more) by script too. Here is how you can do it… You can choose to save this report in a variable to do further processing in your script or you can save it to a file, just...Read More
Related to my last post about how to change BitLocker recovery password from an elevated command prompt here is how you can achieve the same result with vbScript and WMI. This script is from Microsoft TechNet: BitLocker Drive Encryption Operations Guide: Recovering Encrypted Volumes with AD DS. ' Target drive letter strDriveLetter = "c:" ' Target computer name ' Use "." to connect to the local computer strComputerName = "." ' -------------------------------------------------------------------------------- ' Connect to the BitLocker WMI provider class '...Read More
This topic is little more complex and we’ll need different steps to accomplish this feature. First at all you need the pictures for your user objects in the directory. You can use ADSI Edit, Powershell or 3rd party software to put pictures in AD. My blog post “How to save a user picture in Active Directory with vbScript?” will do this for you using vbScript. Second you’ll need a small application that sets a picture on your harddrive as the user account picture. I tested this only with Windows 7 – so there is no guarantee that this works with other versions too. Why...Read More
Active Directory offers the possibility to save pictures in a user’s object. These pictures can then be used in Outlook, Sharepoint or even self-written applications. Here is how you can do it: Function SavePictureToAdFromUrl(szADsPath, szUrl) Dim objUser, bytesRead, adoStreamRead Const adTypeBinary = 1 Set xml = CreateObject("Microsoft.XMLHTTP") xml.Open "GET", szUrl, False xml.Send If xml.status = 200 Then Set adoStreamRead = CreateObject("ADODB.Stream") adoStreamRead.Type = adTypeBinary adoStreamRead.Open adoStreamRead.Write xml.responseBody...Read More
How to connect to and read data from Mailboxes, Calendars, … via Exchange Web Services and vbScript?
I offen wondered how I can programmatically read items from mailboxes stored within Microsoft Exchange Server. Some time ago I used Outlook with some macros that accessed the information I needed. But what if Outlook does not run? Or what if the computer crashed – who would logon and start Outlook? Sure you can find workarounds for every problem. But this never seemed to be a ‘cool’ solution to me. In the past few weeks – after I got my Exchange 2010 MCITP – I started to have a look at EWS – Exchange Web Services (available since Microsoft Exchange Server...Read More
May be some of you already got stuck with the problem about xml http calls, vbscript and secured websites with certificate problems – the others surely will… There are some problems occurring right often. For example the host name does not match the subject name of the certificate or the certificate is not valid (yet) or the certificate’s chain is broken. Here you can see 2 of those errors: Error 80072F0D in msxml3.dll: The certificate authority is invalid or incorrect Error 80072F06 in msxml3.dll: The host name in the certificate is invalid or does not match When opening...Read More