Remko Weijnen's Blog (Remko's Blog)

About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like

Embedding images in HTML

I was creating a small dialog in an .hta file and to make a little prettier for the user I included a company logo:

SNAGHTMLdfa805

But I wanted to deploy the .hta as a single file.

(more…)

Some Active Directory attributes return an 8 byte integer in the form of an IADsLargeInteger interface. An example is the pwdLastSet attribute from a user object.

Because the IADsLargeInteger object doesn’t provide type information PowerShell cannot read the HighPart and LowPart properties.

So I wrote the function below to get the Int64 value of an IADsLargeInteger:

(more…)

Set homefolder permissions with PowerShell

imageToday one of my collegues asked me to write a script that performs two actions for all users of a certain Organizational Unit:

  1. Ensure that each user has modify permissions on their homefolder
  2. Make each user visible in the Exchange Address List.

Sounds like a PowerShell job right?

I reused my function to set NTFS Permissions by SID:

(more…)

  • 0 Comments
  • Filed under: PowerShell
  • Construct AQS date range with PowerShell

    imageFor a script I needed to create an AQS (Advanced Query Syntax) Query that contained a date range.

    An example of such is a range is: date:11/05/04..11/10/04

    However we need to account for regional settings where for example the data seperator and the order of day and month may be different.

    In my example I wanted to match any data that is 30 days or older so let’s do this in PowerShell:

    (more…)

  • 0 Comments
  • Filed under: PowerShell
  • Exchange Move Mailbox Experiences Part 3

    In Part 2 I showed some details about Mailbox Rule corruptions that can disturb Mailbox Moves.

    For this part the topic is Mailbox size, which can be an important factor in deciding which mailboxes you want to move first.

    In my case the mailbox size was important because we agreed to move smaller mailboxes during the day but larger mailboxes only outside working hours.

    For Exchange 2010 mailboxes it’s very easy to obtain the size using PowerShell.

    Example:

    DisplayNameItemCountTotalItemSize
    Remko Weijnen31334.87 MB (36,564,183 bytes

    But how can we get the Mailbox Size for Exchange 2003 mailboxes?

     

    (more…)

    Inline arrays in PowerShell

    imageSometimes I want to process a list of “things” easily in PowerShell where the list is not in an external file but in the script itself.

    Ideally this list would not be separated by e.g. a comma so it can be easily copy/pasted from external data sources.

    Something like this:

    (more…)

  • 2 Comments
  • Filed under: PowerShell
  • I am currently creating a PowerShell script that creates a user with all needed Active Directory attributes, Exchange mailbox, (TS) Home- and Profile directories and so on.

    In such a script you can easily get failures because of Active Directory replication.

    (more…)

    Function below can be used to check if a given Username exists in Active Directory:

    Get smallest Exchange Database in PowerShell

    SNAGHTML1ca684c

    I needed to adapt some scripts that create a user with mailbox for Exchange 2010. The existing scripts had a hardcoded database for new mailboxes.

    I wanted the mailbox to be created in the smallest database, but how do we determine this?

    For Exchange 2010 this is fairly easy using PowerShell:

    Set Exchange Product Key with PowerShell

    SNAGHTML1ca684c

    By default Exchange 2007 and 2010 are installed in Trial mode so before going into production you need to enter the Product Key.

    The Exchange Management Console will warn you if one or more servers are still in trial mode:

    image

    (more…)

    Blogroll


    Categories


    Archives