Naming conformance - using SMTP address naming or User Principle Name (UPN)


We are planning to migrate to O365 through an IT services company and i have been asked
about the requirement for  naming conformance whether we will using SMTP address naming or User Principle Name (UPN)

Not sure what this is related to the O365 migration. Any information or sugessions on this will be great.

Who is Participating?
MAS (MVE)Technical Department HeadCommented:
-->So after migration when the user log into , what will be the UPN,
The active email address will be your UON

-->will they use the email address to log in or the UPN.
UPN will be equal to email address.
MAS (MVE)Technical Department HeadCommented:
Hi lianne143,
When you migrate to O365 your UPN will be changed to your email address,
i.e. emailaddress and UPN in your local AD will be same.

lianne143Author Commented:
The current email format for our organisation is is

Our organisation will be joining another (GAPT) trust  and will changing the email domain and once we migrate the O365
our new email format will be :

So after migration when the user log into , what will be the UPN,
will they use the email address to log in or the UPN.

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Shaun VermaakTechnical Specialist/DeveloperCommented:
Old VBS I wrote years ago

Option Explicit

'On Error Resume Next

Const ForAppending=8

Dim objConnection
Dim objCommand
Dim objRecordSet
Dim strdistinguishedName
Dim strdNSHostName
Dim strTarget
Dim strIPAddress
Dim intCnt
Dim intTotal
Dim strcn
Dim objRootDSE
Dim strDNSDomain
Dim strmail
Dim strADsPath
Dim struserPrincipalName
Dim arruserPrincipalName
Dim objUser
Dim strsAMAccountName
Dim strLeftPartOfUPN
Dim blnShouldRun

Set objConnection=CreateObject("ADODB.Connection")
Set objCommand=CreateObject("ADODB.Command")
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection=objConnection
Set objRootDSE = GetObject("LDAP://RootDSE")

strDNSDomain = objRootDSE.Get("defaultNamingContext")

objCommand.Properties("Page Size")=1000

objCommand.CommandText="SELECT ADsPath,userPrincipalName,sAMAccountName,mail,cn,distinguishedName FROM 'LDAP://" & strDNSDomain & "' WHERE objectCategory='Person' AND objectClass='User'" 
Set objRecordSet=objCommand.Execute

Do Until objRecordSet.EOF
    blnShouldRun = False

    strdistinguishedName = objRecordSet.Fields("distinguishedName").Value
    strcn = objRecordSet.Fields("cn").Value
    strmail = objRecordSet.Fields("mail").Value
    struserPrincipalName = objRecordSet.Fields("userPrincipalName").Value
    strsAMAccountName = objRecordSet.Fields("sAMAccountName").Value

    strADsPath = objRecordSet.Fields("ADsPath").Value
    Set objUser = GetObject(strADsPath)

    If IsNull(struserPrincipalName) Then
        blnShouldRun = True
        'WScript.Echo struserPrincipalName
        arruserPrincipalName = Split(struserPrincipalName,"@")
        If IsNumeric(arruserPrincipalName(0)) Then
            blnShouldRun = True
        End If
    End If

    If blnShouldRun = True Then
        If strmail <> "" Then
            LogAndDisplay(struserPrincipalName & vbTab & strmail & vbTab & strcn & vbTab & vbTab & strdistinguishedName)
            objUser.userPrincipalName = strmail
        End If
    End If

    Set objUser = Nothing


Set objRootDSE=Nothing
Set objConnection=Nothing
Set objCommand=Nothing
Set objRecordSet=Nothing

Sub LogAndDisplay(strLine)
    On Error Resume Next

    Dim objFSO
    Dim objTextFile

    WScript.Echo strLine

    Set objFSO=CreateObject("Scripting.FileSystemObject")
    Set objTextFile=objFSO.OpenTextFile("UpdateUPNtoEmail.log",ForAppending,True)



    Set objFSO=Nothing
    Set objTextFile=Nothing

    On Error Goto 0
End Sub

Open in new window

lianne143Author Commented:
Hi Shaun

What does this VBS script do .
Shaun VermaakTechnical Specialist/DeveloperCommented:
It sets the UPN to the email address
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.