Home Notify Analyst
Options

Is there any way to notify a team mailbox when tickets are assigned to a queue?

Sean_TerrySean_Terry Customer Advanced IT Monkey ✭✭✭

Just curious as it seems to be a feature that staff in our company would like.

Best Answer

  • Options
    Simon_ZeinhoferSimon_Zeinhofer Customer Ninja IT Monkey ✭✭✭✭
    Answer ✓

    the easiest way would be, when the mailbox is a disabled user object in AD and you sync it with the connector. Then it should have a notification object related to it and you can then select it in the subscription.

    If that's not possible you could create a new user or group object with the mail address related as notification object. I did this for external mail recipients, which are not present in AD. I have written a script for that:

    $SMDefaultComputer = 'YOURSCSMSERVER'
    
    $UserClass = get-scsmclass -Id '10a7f898-e672-ccf3-8881-360bfb6a8f9a'
    $AddressClass = Get-SCSMClass -Id 'c08e20e3-c0fe-66b8-8c12-bcc1f3f11d5d'
    
    $HasPreference = Get-SCSMRelationshipClass -Id '649e37ab-bf89-8617-94f6-d4d041a05171'
    
    $firstName = 'Queue1'
    $lastName = 'Mailbox'
    $displayName = $firstName  + " " + $lastName
    $userName = $firstName + "." + $lastName
    $CN = $lastName + " " + $firstName
    $domain = 'SMInternal'
    $distinguishedName = "CN=$CN,OU=QueueMailBox,DC=SMInternal"
    $UPN = 'mailaddressOfQueue'
    
    $newGUID = [guid]::NewGuid().tostring()
    
    $newProps = @{
    
    "FirstName" = $firstName
    "LastName" = $lastName
    "DisplayName" = $displayName
    "UserName" = $userName
    "Domain" = $domain
    "DistinguishedName" = $distinguishedName
    "UPN" = $UPN
    }
    
    
    $newUser = New-SCSMObject -Class $UserClass -PropertyHashtable $newProps -PassThru
    
    $preferenceProps = @{
    
        Id = "{0}";
        ChannelName = "SMTP";
        TargetAddress = $UPN;
        Description = $userName + "_SMTP";
        DisplayName = $userName + "_SMTP";
    }
    
    $newAddress = New-SCSMObject -Class $AddressClass -PropertyHashtable $preferenceProps -NoCommit
    $newPreference = New-SCSMRelationshipObject -Relationship $HasPreference -Source $newUser -Target $newAddress -NoCommit
    $newPreference.Commit()
    


    I hope this helps.

Answers

  • Options
    Simon_ZeinhoferSimon_Zeinhofer Customer Ninja IT Monkey ✭✭✭✭
    Answer ✓

    the easiest way would be, when the mailbox is a disabled user object in AD and you sync it with the connector. Then it should have a notification object related to it and you can then select it in the subscription.

    If that's not possible you could create a new user or group object with the mail address related as notification object. I did this for external mail recipients, which are not present in AD. I have written a script for that:

    $SMDefaultComputer = 'YOURSCSMSERVER'
    
    $UserClass = get-scsmclass -Id '10a7f898-e672-ccf3-8881-360bfb6a8f9a'
    $AddressClass = Get-SCSMClass -Id 'c08e20e3-c0fe-66b8-8c12-bcc1f3f11d5d'
    
    $HasPreference = Get-SCSMRelationshipClass -Id '649e37ab-bf89-8617-94f6-d4d041a05171'
    
    $firstName = 'Queue1'
    $lastName = 'Mailbox'
    $displayName = $firstName  + " " + $lastName
    $userName = $firstName + "." + $lastName
    $CN = $lastName + " " + $firstName
    $domain = 'SMInternal'
    $distinguishedName = "CN=$CN,OU=QueueMailBox,DC=SMInternal"
    $UPN = 'mailaddressOfQueue'
    
    $newGUID = [guid]::NewGuid().tostring()
    
    $newProps = @{
    
    "FirstName" = $firstName
    "LastName" = $lastName
    "DisplayName" = $displayName
    "UserName" = $userName
    "Domain" = $domain
    "DistinguishedName" = $distinguishedName
    "UPN" = $UPN
    }
    
    
    $newUser = New-SCSMObject -Class $UserClass -PropertyHashtable $newProps -PassThru
    
    $preferenceProps = @{
    
        Id = "{0}";
        ChannelName = "SMTP";
        TargetAddress = $UPN;
        Description = $userName + "_SMTP";
        DisplayName = $userName + "_SMTP";
    }
    
    $newAddress = New-SCSMObject -Class $AddressClass -PropertyHashtable $preferenceProps -NoCommit
    $newPreference = New-SCSMRelationshipObject -Relationship $HasPreference -Source $newUser -Target $newAddress -NoCommit
    $newPreference.Commit()
    


    I hope this helps.

Sign In or Register to comment.