Wednesday, 31 January 2018

Posting Code to my blogs

For my own reference to add code to my blogs and not have it edited




Copy the code you want to display in the post

Open Simplecode 

Paste the code in the box and click on enter

Copy the resulting the code and you are done. Just paste the code in blog post to display the code as expected



Sample 1

Straight Paste

3
false
sound
Sound Card
sound
7
ensoniq1371
35 

From Simplecode

<Item>
<rasd:AddressOnParent>3</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Caption>sound</rasd:Caption>
<rasd:Description>Sound Card</rasd:Description>
<rasd:ElementName>sound</rasd:ElementName>
<rasd:InstanceID>7</rasd:InstanceID>
<rasd:ResourceSubType>ensoniq1371</rasd:ResourceSubType>
<rasd:ResourceType>35</rasd:ResourceType>


Its adding the following
A tag called < code >
the < is replaced with & l t ;

Item

The  > is replaced with & g t ;
And a  < br  / >  added to the end of each line for a new line.



Convert a Virtual Box OVA to VMware OVF and deploy



Back in college and trying to deploy the demo lab machines. Images I got were Virtual Box OVA files that would not deploy direct to ESXi. Trying to import an Virtual Box OVA file into ESXi and I got errors. Disk was incorrect, wrong hardware, didn't know disk size and a few other errors.

Found a few sites describing the methods, but never had a full set of instructions.

Tried for a few hours and came up with the below.


Download the VMware OVFTools, login is needed to access the download (correct link on 31/1/2018)

https://my.vmware.com/group/vmware/details?downloadGroup=OVFTOOL350&productId=352


Run OVFtool in Administrator mode and point it at your old
C:\Program Files\VMware\VMware OVF Tool>ovftool.exe E:\Downloads\Malware\Sniffer\Sniffer.ova E:\Downloads\Malware\SnifferOVF\sniffer.ovf


Open up the folder you converted to
Delete the mf file (Sniffer.mf) and edit the ovf file as follows

Then use a text editor to change the following sections in the .ovf file

Change the hardware to ESX suitable hardware



<vssd:VirtualSystemType>virtualbox-2.2</vssd:VirtualSystemType>

to

<vssd:VirtualSystemType>vmx-08</vssd:VirtualSystemType&gt;




Edit the Drive Type from SATA to a SCSI to suit VMware



<rasd:Address>0</rasd:Address>
<rasd:Caption>sataController0</rasd:Caption>
<rasd:Description>SATA Controller</rasd:Description>
<rasd:ElementName>sataController0</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceSubType>AHCI</rasd:ResourceSubType>
<rasd:ResourceType>20</rasd:ResourceType>

to

<rasd:Address>0</rasd:Address>
<rasd:Caption>SCSIController</rasd:Caption>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>SCSIController</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>




Delete the following section for the Sound Card (approx. line 100)

<Item>
<rasd:AddressOnParent>3</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Caption>sound</rasd:Caption>
<rasd:Description>Sound Card</rasd:Description>
<rasd:ElementName>sound</rasd:ElementName>
<rasd:InstanceID>7</rasd:InstanceID>
<rasd:ResourceSubType>ensoniq1371</rasd:ResourceSubType>
<rasd:ResourceType>35</rasd:ResourceType>
</Item>



Then deploy your VM using vCenter/ vSphere Client. This will also deploy the vmdk for you as well.

KCCO

Tuesday, 24 January 2017

Skype for Business Online gives a DNS error



Skype for Business Online gives a DNS error on user logon
I was involved in migrating a business from one Office 365 Tenancy to another for business reasons.
In the old tenancy the users were successfully using SfB online.after migrating to the new tenancy, we have random users not capable of logging into Office 365 Skype for Business.

The odd thing was they were getting DNS errors

The Skype for Business DNS troubleshooter Link indicated that all was good and the fact that some users could connect and others could not from different parts of the world seemed to indicate further issues. The Skype for Business Troubleshooter of Admins Link indicated at step 12 that I may have the following issues
Check for duplicate SIP addresses:
  • KB 2430520: Error in the Office 365 portal: "Value of msRTCSIP-PrimaryUserAddress or the SIP address in the ProxyAddresses field in your local Active Directory is not unique"
Check the msRTCSIP-UserEnabled attribute:
  • KB 2705378: Error message when you try to sign in to Lync Online: "Cannot sign in to Lync because this sign-in address was not found"

After further investigation, it was found that Azure AD Connect had replicated some msRTC… attributes. Looking at a user using ADSIedit I found the following attributes on a user, that I cleared or set to not set

msRTCSIP-DeploymentLocator SRV:
Cleared this attribute
msRTCSIP-FederationEnabled true
Set to not set
msRTCSIP-InternetAccessEnabled true
Set to not set
msRTCSIP-OptionFlags 257
Cleared this attribute
msRTCSIP-PrimaryHomeServer CN=Lc Services,CN=Microsoft,CN=1:1,CN=Pools,CN=RTC Service,CN=Services,CN=Configuration,DC=domain,DC=IE
Cleared this attribute
msRTCSIP-PrimaryUserAddress sip:a.user@domain.IE
Cleared this attribute
msRTCSIP-UserEnabled true
Set to not set
msRTCSIP-UserPolicies 0=2023619321
Cleared this attribute

Clearing these attributes on on premise AD and then forcing a full synchronisation with Azure AD Connect, I could see the user update the cleared records.
Using the Powershell command

Get-CsOnlineUser -identity a.user@domain.ie | select OnPremSipAddress

I saw that the output had the attribute clear and Skype for Business could log in.

Running a slightly different query returned all the other users I had the issue with
# This will find the Lync onpremise enabled users.
Get-CsOnlineUser | select OnPremSipAddress | out-gridview

Turns out there was a Lync Server deployed in the early naughtys that was just unplugged and removed.