Pages

Monday, July 6, 2015

Add list of users to AD group from .csv file

This script will use a .csv file containing a list of usernames that need to be made members of an AD group.
The first cell in the column containing the usernames must use the value “Name”.

$ListOfUsers = Import-csv -Path <INSERT PATH TO .CSV FILE>
$ItemDetails = $NULL

foreach ($item in $ListOfUsers)
{
$ItemDetails = get-aduser -Identity $item.name -properties * -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
if ($ItemDetails -eq $NULL)
    {
    Write-Host $item.name "does not exist in AD"  -ForegroundColor Red
    $ItemDetails = $NULL
    }
else
    {
    Write-Host $item.name  "does exist in AD" -ForegroundColor Green
    $ItemDetails.DistinguishedName
    $GroupToAddTo = get-adgroup -Identity "<INSERT GROUP NAME>"
    Add-ADGroupMember -Identity $GroupToAddTo -Member $ItemDetails.DistinguishedName
    $ItemDetails = $NULL
    }
}

Add list of computers to AD group from .csv file

This script will use a .csv file containing a list of computers that need to be made members of an AD group.
The first cell in the column containing the computer names must use the value “Name”.

$ListOfComputers = Import-csv –Path <INSERT PATH TO .CSV FILE>
foreach ($item in $ListOfComputers)
{
$ItemDetails = Get-ADComputer -identity $item.Name -properties * -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
if ($ItemDetails -eq $NULL)
{
Write-Host "$item does not exist in AD" -ForegroundColor Yellow
$ItemDetails = $NULL 
}
else
{
$ItemDetails.DistinguishedName
$GroupToAddTo = get-adgroup -Identity "<INSERT GROUP NAME>"
Add-ADGroupMember -Identity $GroupToAddTo -Member $ItemDetails.DistinguishedName   
}
}

Tuesday, September 6, 2011

Exchange 2010 Update Rollups Breaks OWA

Outlook Web Access broke today after a Windows Update Rollup 4-v2 for Exchange Server 2010 SP1.

Trying to access OWA will get you the following error:

    Outlook Web App didn’t initialize. If the problem continues, please contact your helpdesk.

    Couldn’t find a base theme (folder name=base)

To fix it, open Exchange Management Shell and run the following powershell script:

   C:\Program Files\Microsoft\Exchange Server\V14\Bin\UpdateCas.ps1

Friday, June 17, 2011

Upgrading firmware on 3Com 4500 switch

This is a step-by-step on how to upgrade the firmware on a 3Com 4500 series switch.

Before starting, the switch needs to be on the network and be able to "see" the TFTP server.

Just to be on the safe side, before upgrading do a BACKUP! Once the TFTP software is set up and pointing to the folder that will contain the backup files, connect to a terminal session and go trough the following sequence:

<4500>tftp 192.168.0.1 put flash:/s3p01_00.web
<4500>tftp 192.168.0.1 put flash:/3comoscfg.def
<4500>tftp 192.168.0.1 put flash:/3comoscfg.cfg
<4500>tftp 192.168.0.1 put flash:/s3n03_01_00s56p01.app


Next thing that needs to be done is deleting the old firmware to make room for the new one. Make sure that you are not deleting the configuration files (3comoscfg.def & 3comoscfg.cfg).

<4500>delete /unreserved s3p01_00.web
<4500>delete /unreserved s3n03_01_00s56p01.app
<4500>dir
Directory of unit1>flash:/

   0   -rw-      5195  Jan 01 1970 00:02:27   3comoscfg.def
   1   -rw-      4914  Apr 01 2000 23:57:51   3comoscfg.cfg

7239 KB total (7098 KB free)

Now to get on with the upgrade, set up the TFTP software to point to the folder containing the new software, than run the following sequence in the terminal.

<4500>tftp 192.168.0.1 get flash:/s3p04_04.web
<4500>tftp 192.168.0.1 get s3p04_04.web
<4500>tftp 192.168.0.1 get s3o04_06.btm
<4500>tftp 192.168.0.1 get s3n03_03_02s168p15.app

Next step is to configure which files will be used by the switch on the next boot.

<4500>boot boot-loader flash:/s3n03_03_02s168p15.app
<4500>boot bootrom flash:/s3o04_06.btm
<4500>dir
Directory of unit1>flash:/

   1       -rw-    995524  Apr 02 2000 01:31:13   s3p04_04.web
   2       -rw-      5195  Jan 01 1970 00:02:27   3comoscfg.def
   3       -rw-    195022  Apr 02 2000 01:31:53   s3o04_06.btm
   4 (*)   -rw-      4914  Apr 02 2000 01:35:26   3comoscfg.cfg
   5 (*)   -rw-   4221603  Apr 02 2000 01:33:28   s3n03_03_02s168p15.app

7239 KB total (1811 KB free)
(*) -with main attribute   (b) -with backup attribute
(*b) -with both main and backup attribute


Finally, the configuration needs to be saved.

<4500>save

Friday, June 3, 2011

Configuring a port for a specific VLAN on a 3Com 4500 switch

Let's say I have a 3Com 4500 10/100Mb switch deployed as an edge switch. 

In this instance, port 1 on this switch needs to be configured to support a Wireless AP connecting to a central Wireless Switch trough VLAN 1.

After connecting to the switch, either trough a serial cable or using telnet, the following commands need to be used to achieve this:

<4500>sys
System View: return to User View with Ctrl+Z.
[4500]vlan 1
[4500-vlan1]description Wireless_Test
[4500-vlan1]interface Ethernet 1/0/1
[4500-Ethernet1/0/1]port link-type trunk
[4500-Ethernet1/0/1]port trunk permit vlan 1
[4500-Ethernet1/0/1]port trunk pvid vlan 1
[4500-Ethernet1/0/1]description Wireless_Test

After saving the configuration, any wireless clients should be able to connect to a Wireless AP plugged into port 1 and get a DHCP address.

Monday, November 22, 2010

MS 70-646 - too easy?

  Just went trough my 70-646 today ... a little late according to some, but I wanted to get some experience on Server 2008 & Server 2008 R2 before taking the exam.

  What can I say ... since this is a PRO exam, I was unpleasantly surprised about how easy it was (a little harder than 70-649, but still ...). At least I had about three scenarios to play with, not just the standard multiple choice questions.

  I would have expected this to be a lot harder than the TS exams, or maybe have more scenarios than questions, but for that I might have to wait until the MCM ... maybe MCA? :-)