Exchange – Export Distribution Groups AND Members to a file

KB ID 0000209 

Problem

Yes you can use the Powershell commands,

Get-DistributionGroupMember –identity “group name” | ft name, primarysmtpaddress

But you have to do that for every group and I’ve tried Piping the Get-DistributionGroup in there but it does not seem to want to work 🙁

Solution

1. Download this script and extract it to the root of the Exchange servers C: drive.

2. On the Exchange server > Click > Start > All Programs > Microsoft Exchange Server 2007 > Exchange Management Shell.

3. Issue the following command cd “c:” {enter}

4. Issue the following command ./all_members.ps1 {enter}

5. On the Exchange Server navigate to C:Exchange_Groups.csv (open with Microsoft Excel).

Possible problem;

Powershell Scrpt signing Policy

Change scipt execution policy with a set execution command.

Depending on your script signing policy, you might see.

File {path} cannot be loaded the file {path} is not digitally signed. The script will not execute on the system. Please see “get-help about_signing” for more details..

If you see this enter the following,

Get-ExecutionPolicy {enter}

It will say Restricted, Remote Signed or All Signed “Take Note”

Issue the following command

Set-ExecutionPolicy Unrestricted {enter}

Then run the all_member script, when finished change it back with

Set-ExecutionPolicy {what it was earlier}{enter}

 

Related Articles, References, Credits, or External Links

All Credit to Jon-Alfred Smith – Who put the script here

Excel – IP Address Formula for ‘Auto fill’

KB ID 0000928 

Problem

I got asked this week if I know how to do this, a colleague was doing a spreadsheet, and needed to quickly put in IP addresses. The Problem is if you use ‘Auto Fill’ to continue your IP addresses, it does not behave quite like you would expect.

Solution

A quick search got me most of the way there, but the solution is different depending on which ‘octet’ of the IP address you want to increase.

So simply change the figures in red below, drop the formula into a cell on your spreadsheet then use the auto fill option.

Excel IP Addresses Increment the First Octet

[box]
=””&ROWS($A$1:A10)&”.1.1.0“[/box]

Excel IP Addresses Increment the Second Octet

[box] =”10.“&ROWS($A$1:A1)&”.1.1“[/box]

Excel IP Addresses Increment the Third Octet

[box] =”10.1.“&ROWS($A$1:A1)&”.1“[/box]

Excel IP Addresses Increment the Fourth Octet

[box] =”10.1.1.“&ROWS($A$1:A1)[/box]

 

 

Related Articles, References, Credits, or External Links

Excel: Calculate Cost, Margin, Sell Price

Excel – Creating a Dropdown Box ‘From data on another sheet’

Bulk Export Users From One Domain, and Import Into Another

KB ID 0000794 

Problem

I’ve written in the past about bulk importing users with CSVDE, but what if you want to move/migrate your users to another domain? You first need to export all the users, then import them into the new domain.

Solution

Step 1 Export Domain Users to CSV File

1. Here all my users are in one OU, if that OU has ‘nested OU’s within it that’s OK.

2. The command to ‘export’ is as follows;

Note: You need to ‘run as administrator

[box]

csvde -d {LDAP Path} -f c:\filename.csv

Example

csvde -d "ou=Main-Site,dc=pnl,dc=com" -f C:\ExportedUsers.csv

[/box]

3. The users will be exported. If it fails at this point it will give you a descriptive error, CSVDE has been around for a while, Google the error (most fixes are pretty simple).

4. Now open the CSV File with Excel, the second line will probably be the OU, you can leave this here if you want but if your target OU is different (or Like me you prefer to create it manually), then delete row 2 (Don’t delete Row 1!).

5. You do not need all the columns, delete all the columns EXCEPT,

DN
objectClass
ou
distinguishedName
name
cn
sn
givenName
displayName
sAMAccountName
userPrincipalName

So when complete it should look like the following;

6. Change any details in the LDAP path that are different for the new domain.

7. You may also need to change the domain name that’s listed on the userPrincipleName.

Step 2 Import Domain Users from CSV File

1. On the target domain, (if you are not importing the OU’s, then make sure they already exist). The syntax for the import is;

[box]

csvde -i -f c:\filename.csv

 

[/box]

9. Your users should be imported.

10. By default they will be disabled, but you can bulk enable them.

11. At this point all the users have no password, this can also be bulk set.

Windows – Reset all User Passwords in an OU

 

Related Articles, References, Credits, or External Links

NA