Showing posts from 2018

Script to quickly create a pastable list of AD users in Powershell.

I might rewrite this in powershell at some point, but due to my familiarity with python, I tossed this together to create a pastable list of AD users for a collaboration lab environment spin up.  Hopefully this saves someone time.

list = ["John Doe", "Jane Doe"]
for fullName in list:
   nameList = fullName.split(" ")
   firstName = nameList[0]
   lastName = nameList[1]
   print("$Attributes = @{")
   print("    Enabled = $true")
   print("    ChangePasswordAtLogon = $false")
   print("    PasswordNeverExpires = $true")
   print("    UserPrincipalName = \"" + lastName.lower() + firstName[0].lower() + "\"")
   print("    Name = \"" + lastName.lower() + firstName[0].lower() + "\"")
   print("    GivenName = \"" + firstName + "\"")
   print("    Surname = \"" + lastName + "\"")
   print("    DisplayName = \"" + fullName + "\"")
   print("    Office = \"Remote\"")
   print("    Company = \"Company\"")
   print("    Department = \"Support\"")
   print("    Title = \"Test User\"")
   print("    City = \"New York\"")
   print("    State = \"New York\"")
   print("    AccountPassword = \"CHANGEME\" | ConvertTo-SecureString -AsPlainText -Force")
   print("New-ADUser @Attributes")
   print("Set-ADUser -Identity " + lastName.lower() + firstName[0].lower() + " -Add @{\"msRTCSIP-PrimaryUserAddress\" =\"sip:" + lastName.lower() + firstName[0].lower() + "\"}")

Policy Based Routing on a Cisco Switch

While policy based routing is available on a great many Cisco switches, you will need the right firmware that supports it.  For my home lab, a 3560X is my main switch, it requires 15.1-15.3 to work, currently 15.2 has MD releases, which is what I used.  A quick show sdm prefer will output the features you have available, ensure ip routing is enabled as well.

Lastly, as far as creating an access list for policy based routing, ensure you deny your internal networks in the ACL prior to implementation or a lot of things won't work.

access-list 100 deny   ip
access-list 100 permit ip any

This ACL will allow you to policy route all traffic that is external to a next hop.


Vsphere 6.7 OVA issues.

In the new release of VMWare's Vsphere which is currently a release candidate you may get many OVA errors.  In many collaboration OVA's there are dual purpose sections where the XML portion may include a comma.  Currently, Vsphere will report errors when importing them, you need to copy the section entirely, remove the comma and have both.

This section will create errors:

      <Item ovf:configuration="CUCM_10000,CUCM_2500_small_disk">
        <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
        <rasd:Description>Number of Virtual CPUs</rasd:Description>
        <rasd:ElementName>4 virtual CPU(s)</rasd:ElementName>
To fix:

      <Item ovf:configuration="CUCM_10000">
        <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
        <rasd:Description>Number of Virtual CPUs</rasd:Description>
        <rasd:ElementName>4 virtual CPU(s)</rasd:ElementName>
      <Item ovf:configuration="CUCM_2500_small_disk">
        <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
        <rasd:Description>Memory Size</rasd:Description>
        <rasd:ElementName>3072MB of memory</rasd:ElementName>

Now just do a sha1sum on the updated ovf, update the manifest and reimport it into your OVA.