Sunday, June 19, 2022

 I have a win32 (TASBS) program that will only run on a win 32 system.  To run it on Windows 10 I have to set up a hyper V machine with WinXP.  It wasn't a pleasant experience but here is what I did.

I got a valid WinXPPro iso and Key

Created a new machine in HyperV and loaded the iso in the media disk and installed the operating system.

It will work for about 30 days but if you need it for longer you have to activate it, but microsoft doesn't support xp anymore.  Even so you can still activate it by phone.  

1.  Click the activate button and select activate by phone.

2.  A phone number will appear (some other local ones may work).  Call the number and say you are activating windows.  One of the next prompts is to use the auto-activation method (don't use any of the others).  You will then be asked to read the activation code on the screen and they will give you code to enter into the machine. (takes about 10 minutes).  If you can mange to enter about 50 characters without a mistake, then it should be activated.

3. To get network connection you need to setup a switch that is connected to the physical network adapter.  

  1. In the HyperV actions select Virtual Switch Manager
  2. Click on New Virtual Switch
  3. Select External
  4. Select the network adapter you want to link to
  5. Click allow management operating system to share this adapter
  6. Apply.
In my case step 3 got an error. (My hyperV was installed a while ago and not used).  To resolve the error:
  1. Uninstalled hyper V from Windows Features.
  2. restarted the machine
  3. opened an admin command prompt or PS and type: netcfg -d  (from https://techgenix.com/resolving-problems-creating-a-hyper-v-virtual-switch/ )
  4. restart computer again and reinstall hyperV
  5. Create a new machine and attach the disk created in 1.  
  6. Create the new Virtual Switch as above.
Under the machine select settings.
  1. Delete the default Network adapter.
  2. Add New Hardware and select legacy network adapter.
  3. For Virtual switch select the switch you just created.
I also had DNS problems as the adapter used IP6 settings.  You may need to manually change the DNS IP in the network properties of the VM's network adapter.

I had another problem with the TASFTP software that wouldn't keep my ftp settings.  I had to go into the TASFTP directory and change a file called wakeup and reenter the settings as the software was unable to save the settings.

Sunday, February 09, 2020

Index problems with shared mailbox in outlook


Shared mailbox was not indexed properly in outlook (items did not appear on search).  The solution is to remove automapping from the user.  create a new profile and add the shared mailbox as an additional account (not from the add shared mailbox dialog).

I.  Remove user permissions on the shared mailbox, and readd them removing automapping.
1. Please create a new outlook profile in control panel.​

2. Repair the office 365 set up. ​
3. Remove the shared mailbox from end user outlook email client and re-add it.

Close Outlook.
​Go to Start > Control Panel > Click on Mail.
The Mail Setup window will pop up.
​Click on Email Accounts.
Select your profile and click on Change.
Select More Settings.
On the Advanced tab, select the Shared Mailbox and click Remove.
Open Outlook again and reconnect the shared mailbox following the same process. 


4. Correcting folder permissions on shared mailbox by following the below mentioned commands.​
Open the Powershell as an administrator and run the below mentioned commands one at a time.​

Set-ExecutionPolicy RemoteSigned ​​
 ​
 (After running the command please type in yes)​​
​​
 $UserCredential = Get-Credential ​
 (Enter your complete global admin credentials, when prompted)​​
​​
  $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection​
 Import-PSSession $Session ​
​Start-Transcript​
Remove-MailboxPermission -Identity sharedmailbox@domain.com -User usermailbox@domain.com -AccessRights FullAccess​ -AutoMapping:$false
Type Yes and press enter when prompted.​
Now re-add the end user to shared mailbox by using the below command:​
Add-MailboxPermission -Identity sharedmailbox@domain.com -User usermailbox@domain.com -AccessRights FullAccess​ 
Stop-Transcript​

go to new profile.  Open mailbox settings and add new account as in this blog 

File=>AccountSettings => New
Enter the shared mailbox.  It will ask you for a password, click sign in with another account.
Sign in with client primary mailbox account and the shared mailbox should be added to the profile.

It will take awhile for the indexing to complete.


​Didn't do this.  
Note: After running the Start-Transcript command it will save a notepad file on a specific location of your system. Please share the same file with us.
5. Now login to your the office 365 portal and go to the Exchange Admin Center.​
Navigate for the recipient menu.​
Click on shared and double click on the impacted shared mailbox profile.​
On the left hand side navigation pane search for mailbox features.​
Under the mailbox feature search for MAPI.​
If it is enabled then please disabled the same and wait for around 30 minutes.​
Upon completion of 30 mins please re-enable the MAPI​
6. Download the Sara tool on the impacted end user's and run the same to further troubleshoot the issue.




Monday, April 22, 2019

UI disappeared in winforms

I had a problem with one of my winforms in an application that was upgraded.  There were several problems with the form

1.  None of the UI elements were visible in design time.
2.  Upon build vb generated an initializecomponet sub in the form's backend (not in the designer.vb) which conflicted with the initializecomponet sub in the designer.vb.  
3.  The designer.vb did not appear under its form in the solution explorer tree, but as a separate file.

The problem was the vbproj file was corrupted.  Here is how a form should appear in the xml file:

 
      EditHTML.vb
   
   
      Form
   
  
 
      EditHTML.vb
   

Some of the dependencies were missing.  When they were fixed to the above format.  Everything worked.

Monday, July 09, 2018

Change Display Name in Office 365 Synced Active Directory

After installing office 365 for all the users and syncing the directory I found that the display name of a user was misspelled.   There was a lot of confusing information on google including to use AzureADPreview module in powershell.  This did not work as one cannot change the attributes in Azure AD if you are using directory sync.

First you need to make the changes in your on premise AD.  .  
Open active directory Users and computers
In the menu on the top, click View and click on "Show Advanced Features" ( or do nothing if checked)
Open the properties of the user to be edited.  Click on Attribute editor.  Change the values of both 
cn
displayName 

to the new value.  Click Ok 
Right click on the User object in the explorer pane and click on 'refresh'.  Check that the user was indeed updated.  

displayName is not a property synced by default by Azure AD Connect, so you have to add a new rule to the synchronization editor of Azure AD Connect.  The following link explains how to add the rule:

In brief one needs to 
Stop the AD Sync Service
Create a rule with the "Synchronization Rules Editor"
(Add a new rule for users which syncs the displayName to AD).

Open Azure AD Connect and resync.  

The user may need to logon once or twice for it to show up.  I didn't have to reinstall outlook 2016, the display name updated on its own.



Tuesday, June 26, 2018

Migrating mail from hosted exchange to Office 365

This is a description on how I have migrated our email from a hosted exchange to office 365.  This is not an authoritative or definitive guide, its a description on what I did, what worked well and what worked not so well and some suggestions on how I would do it if I had to do it over again.

Description of office:  We are only 5 workers and 3 shared email boxes.  We have Active Directory (windows server 2012) installed.  We also have an internal server with AD and a website server on the DMZ with our domain also with AD and proper firewalls in place.  The local, internal domain is different from the public domain.  Also the username convention in AD is first name + last initial, while the username of the email address has no specific convention.  Our DNS records are hosted by the same company that hosted our exchange.

General Strategy:  The exchange host would not assist in transferring the existing mailboxes to office 365.  Looking at the various options I chose the cutover method.  As there are only 5 users I decided against any bulk method of transferring the existing emails.  The general strategy was to export the existing mailboxes to psts and then import them to the new mailboxes.

Step 1:  Preparing the existing AD for office 365.
a.  Add a new UPN suffix to the domain.  (This must be done as the existing upn suffix of the internal AD does not match our public domain.
     1.  Open Active Directory Domains and tursts
     2.  right click Active Directory Domains... in the left panel and click on properties
     3.  Add the new UPN suffix
     This will now be available to assign to the users.
b.  Change the User's logon name
     1.  Open active directory Users and computers
     2.  In the menu on the top, click View and click on "Show Advanced Features"
     For each user who will use exchange
     3.  Double click on the user
     4.  Click on the accounts tab
     5.  change the user logon name to his email username (without the domain)
     6.  Select the domain you added in step a3.  and click OK
     7.  click on the attribute Editor
     8.  Scroll down (or use the keyboard) to proxyAddresses
     9.  Enter the following:  SMTP:myuser@mycompany.com  (substitute correct email for user after SMTP).  Click add and ok.
    10.  While in the attribute editor scroll to preferedLanguage  enter the desired code.  (here's a list).  This is important if your users don't all use the same language, or their local computer has a different language or area preference than the one they prefer to use office in.
    11.  (Not sure if necessary).Click on general tab and enter email.

Note (I did steps 7-10 after I setup some of the users and their email shows up as firstname+Initial@onmicrosoft.com in outlook. Do this before setting up any accounts on the client.

c.  Export the mail folders to pst.
    1.  On one computer with outlook 2013,  I set up accounts for each email I want to copy.  (Obviously this could be done on each computer individually).
    2.  make sure in setting up the emails, that the cache period of the ost. is set for all.
    3.  Wait about 24 hours for all the emails to be downloaded to the cache.
    4.   In outlook, export the mailboxes (all folders, subfolders etc) to pst.
   Note:  The timing of this stage is important.  If there emails arrive between the export stage and the import stage then they will be missing from the new mailbox.  If this is critical, then I suggest that before exporting the emails, change the MS records listed in step d.  That way all new email will go directly to the office 365 account and the import process will add to the new emails.

d.  Set up the domain in Office 365
    1.  One needs to enter the administrators portal in office 365 and add the domain to office 365. There are many videos and explanations on how to do this and the wizard worked very well for me.  Here is one such link:  https://support.office.com/en-us/article/add-a-domain-to-office-365-6383f56d-3d09-4dcb-9b41-b5f5a5efd611

e.  Sync local AD to Office 365.
    1.  AD sync must be installed  and run on your local AD machine.  Again this is fairly straight forward as I had one forest and used express settings.  Here is a link which explains the process:
https://docs.microsoft.com/en-us/azure/active-directory/connect/active-directory-aadconnect-get-started-express
    2.  Wait a while until you see all the users and objects in your office 365 portal.  You can now assign office 365 license to each user in the portal.  (assuming you bought enough licenses).
    3.  Have the users go to the office portal and login with their emails and passwords (which is the same as their AD password) to see that it works.  Don't install office apps yet.

d.  import psts to new mailboxes.
    1.  in the computer you used to export the mailboxes (or in each individual computer).  go to the control panel and double click the mail icon.
    2,  Click on show profiles and then add new profile.  (we'll call it office365).
    3.  Select the radio box  "Prompt for a profile to be used"
    4. Enter a new email account for each user.  (If the DNS records are set up properly, you should be able to add the accounts by just entering the emails).
    5.  Open outlook and select the office365 profile.
    6.  Go to File-> import/export -> import from file -> pst file and select the appropriate pst file you saved in stage c and import to the matching mailbox.  (This can take a while and if the mailbox is large it can take even longer to sync to the server).
   7.  In each user's personal computer (if you used a single one in step d1),  repeat steps d2-4.  (Installation of office 2016 desktop app copies from the existing profile and will not automatically add the new email).
   8.  Open outlook in the new profile to see if the new mailbox is working.  If so go back to step 3 and select "Open with this profile"  and select office365 in the combo box below.

e.   Each user can go to office portal and install the desktop apps.







 






Monday, November 06, 2017

Migating Com+ component from one server to another

I recently migrated a windows 2008 web server to windows 2016.  One of the glitches that I failed to notice right away was that one of my website was using an old Com+ component.  The component was written in ancient vb.net  and while I still have the source code I didn't want to start rewriting everything just yet.  Besides it was useful for the security of the site as the component had its own identity and limited use to the database it was accessing.  After considerable trial and error these are the steps required for it to work.  For this example we'll call the component mycomp.dll.

1.  Register the component in the GAC of the server.  I thought I had a 32 bit/64 bit conflict but in the end I was able to register it as a 64 bit component.
    a.  Copy  the dll, tlb, xml, pdb files to Windows\System32 directory.
    b.  Open an elevated command prompt and navigate to the latest .net framework, which in my case was:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319
   c.   Register the file in GAC using the command:
         RegAsm.exe c:\windows\System32\mycomp.dll

 2.   Now you can add the component to a com+ application

a.  Open in Administrative tools the component services snap in.
b.  open the console Root tree Component services-> Computers->  My Computer
c.  right click on COM+ Applications  and select new
d.  Click through the wizard and select Create Empty  
Application. 
f.  Finish the wizard configuring the application as required by your needs.
g.  When finished open up the COM+ Applications in the console root
h.  Expand the application you just created and right click on Components
i.  Select new -> Component.  The wizard opens and click next
j.  select install new component (very important)
k.  a file dialog will open, select mycomp.tlb.  and click through the wizard adding whatever roles you need for the component.
l.  Back in the console tree open the components, open the component you just added and open the roles.
m.  Right click on the role you created and click new user.  This will open a dialog where you can add users.  (Note If you select the interactive user as owner of the com+ application this may not be necessary. )

 Now you have an application that should work on the new server.







Tuesday, July 18, 2017

Installing programs when mydocs is on network share

Some programs will crash on install when your my documents is located on a mapped drive on a network share.  The reason is that the mapped drive is associated with your user account, and the install uses the administrator account to install the program.  Thus the share does not exist on the administrator account and the program will crash if it starts looking for the mapped drive.

The solution is rather simple.  open up an elevated command prompt (in windows 10 right click on the window menu choose command prompt (Admin)

type in the prompt

net use [mapped drive:]  [networkshare]  
example  If your my documents is mapped to the U drive and its found on \\myserver\myname  folder you would type

net use u:  \\myserver\myname

The admin account has the same mapping as your user account now and you can install the software.