System management API

Looking for system management API like FT-1800 CMS(Configuration Management System)
This is very important facet to develop Telco market.
Pls mail me directly. [email protected]

Not sure if the attached VI will work across various Windows OS's since it uses a powershell command and I also don't know how well the command used will work across 32/64 bit applications...But, so far this little VI I came up with is returning the software that I want to query. Hope this is usefull for others and, as always, suggestions for improvement are welcomed!
Tim Sileo
RF Field Account Specialist
National Instruments
You don’t stop running because you get old. You get old because you stop running. -Jack Kirk, From "Born to Run" by Christopher McDougall.
Attachments:
NI_Software_Query(CMD).vi ‏12 KB

Similar Messages

  • System Configuation API for Configuration Management

    Hi all,
    I've been toying around with the system configuration API for a little bit now and I see it as a great way for companies to use it as part of an overall configuration management utility. For example, if a customer wants to build up a new test rack with the same hardware aliases, configuration, and installed NI software then the system configuration API helps with most of this. I've already created a simple utility that can be used to query the currently installed hardware (of a local or remote system) and then programmatically rename the aliases based on a loaded configuration file or manual input. Likewise, the MAX export/import functionality can also be used. My application of this would primarily be non-RT and mostly PXI products but a good design could enable it to work for both.
    So, my question to the community is actually on the side where I haven't used the System Configuration API yet which is querying the installed software on a system. The software querying functionality of the System Configuration API is really only geared towards RT targets and not Windows based controllers. I'd like to be able to export a list of installed software/drivers on an older system and then compare it with what is installed on a newer system to make it easier for customers to determine whether they have everything required. I know that the MAX export or report has a list of installed software but is parsing this the best way of retrieving installed software (It's a beast of a file)? Does anyone have a better method?
    Regards,
    Tim Sileo
    RF Field Account Specialist
    National Instruments
    You don’t stop running because you get old. You get old because you stop running. -Jack Kirk, From "Born to Run" by Christopher McDougall.
    Solved!
    Go to Solution.

    Not sure if the attached VI will work across various Windows OS's since it uses a powershell command and I also don't know how well the command used will work across 32/64 bit applications...But, so far this little VI I came up with is returning the software that I want to query. Hope this is usefull for others and, as always, suggestions for improvement are welcomed!
    Tim Sileo
    RF Field Account Specialist
    National Instruments
    You don’t stop running because you get old. You get old because you stop running. -Jack Kirk, From "Born to Run" by Christopher McDougall.
    Attachments:
    NI_Software_Query(CMD).vi ‏12 KB

  • Getting the message "The sharing message is not supported." while sharing the calendar using ews managed api.

      public void ShareCalendar(Calendar calendar)
                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
                  service.Credentials = new NetworkCredential("user1", "password", "domain");
                service.Url = new Uri("https://sampleUrl/ews/exchange.asmx");
                try
                    // Bind to the folder
                    //Folder folderStoreInfo;
                    //folderStoreInfo = Folder.Bind(service, calendar.ExchangeId);
                    //string EwsID = folderStoreInfo.Id.UniqueId;
                    string EwsID = calendar.FolderExchangeId;
                    // The value of folderidHex will be what we need to use for the FolderId in the xml file
                    AutodiscoverService autoDiscover = new AutodiscoverService(ExchangeVersion.Exchange2013);
                    autoDiscover.Credentials =  new NetworkCredential("user1", "password", "domain");
                    autoDiscover.RedirectionUrlValidationCallback = RedirectionUrlValidationCallback;
                    Dictionary<string, string> userSettings = GetUserSettings(autoDiscover);
                    string folderidHex = GetConvertedEWSIDinHex(service, EwsID, "[email protected]");
                    string domainName = string.Empty;
                    string mailBoxServer = string.Empty;
                    string userName = string.Empty;
                    foreach (var item in userSettings)
                        switch (item.Key)
                            case "UserDN":
                                domainName = item.Value.ToString();
                                break;
                            case "InternalMailboxServer":
                                mailBoxServer = item.Value.ToString();
                                break;
                            case "UserDisplayName":
                                userName = item.Value.ToString();
                                break;
                    string entryId = GetIntiatorEntryID(domainName);
                    string mailboxId = GetInvitationMailboxId(mailBoxServer, domainName);
                    string sharedFilePath = CreateSharingMessageAttachment(folderidHex, userName, entryId, mailboxId, "[email protected]", "calendar", calendar.FolderName);
                    // Create a new message
                    EmailMessage invitationRequest = new EmailMessage(service);
                    invitationRequest.Subject = "I'd like to share my calendar with you";
                    invitationRequest.Body = "Sent by Exchange Administrator on behalf of user";                
                    //invitationRequest.Culture = "en-US";
                    invitationRequest.Sensitivity = Sensitivity.Normal;
                    // Set a sharing specific property on the message
                    invitationRequest.ItemClass = "IPM.Sharing"; /* Constant Required Value [MS-ProtocolSpec] */
                    byte[] byteEntryId = HexStringToByteArray(entryId);
                    // This is the Guid of the Sharing Provider in Exchange, and it's value does not change
                    Guid binSharingProviderGuid = new Guid("{AEF00600-0000-0000-C000-000000000046}");
                    // Even though I don't think setting this property is mandatory, 
                    // it just seemed like the right thing to do and it works so I \
                    // ain't messin with it!                                        
                    byte[] byteSharingProviderGuid = binSharingProviderGuid.ToByteArray();
                    string strPRBODYHTML = "<html dir=\"ltr\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n<meta name=\"GENERATOR\"
    content=\"MSHTML 8.00.7601.17514\">\r\n<style id=\"owaParaStyle\">P {\r\n   MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px \r\n}\r\n</style>\r\n</head>\r\n<body fPStyle=\"1\" ocsi=\"0\">\r\n<tt>\r\n<pre>SharedByUserDisplayName
    (SharedByUserSmtpAddress) has invited you to view his or her Microsoft Exchange Calendar.\r\n\r\nFor instructions on how to view shared folders on Exchange, see the following article:\r\n\r\nhttp://go.microsoft.com/fwlink/?LinkId=57561\r\n\r\n*~*~*~*~*~*~*~*~*~*\r\n\r\n</pre>\r\n</tt>\r\n<div>\r\n<div
    style=\"direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;\">this is a test message</div>\r\n</div>\r\n</body>\r\n</html>\r\n";
                    string strBODY = @"
    SharedByUserDisplayName (SharedByUserSmtpAddress) has invited you to view his or
    her Microsoft Exchange Calendar.
    For instructions on how to view shared folders on Exchange, see the
    following article:
    http://go.microsoft.com/fwlink/?LinkId=57561
    *~*~*~*~*~*~*~*~*~*
    test body
                    // Convert these to hex and binary equivelants to assign to their relevant
                    // extended properties
                    string hexPRBODYHTML = ConvertStringToHex(strPRBODYHTML);
                    byte[] binPRBODYHTML = HexStringToByteArray(hexPRBODYHTML);
                    Guid PropertySetSharing = Guid.Parse("00062040-0000-0000-C000-000000000046");//constant 
                    Guid PropertySetInternetHeaders = Guid.Parse("00020386-0000-0000-C000-000000000046");//constant
                    ExtendedPropertyDefinition PidLidSharingProviderGuidProperty = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.CLSID);
                    ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
                    // Sharing Properties (in order of reference according to protocol examples in: [MS-OXSHARE])
                    // Additional Property Constraints
                    // [MS-OXSHARE] 2.2.5.2
                    ExtendedPropertyDefinition PidTagMessageClass = new ExtendedPropertyDefinition(0x001A, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.5.1
                    //ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "Content-Class", MapiPropertyType.String);
                    ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "Content-class", MapiPropertyType.String);
                    // Common Message Object Properties               
                    // [MS-OXSHARE] 2.2.1
                    ExtendedPropertyDefinition PidTagNormalizedSubject = new ExtendedPropertyDefinition(0x0E1D, MapiPropertyType.String);
                    // The PidTagSubjectPrefix is a zero-length string, so I do not set it
                    // ExtendedPropertyDefinition PidTagSubjectPrefix = new ExtendedPropertyDefinition(0x003D, MapiPropertyType.String);
                    // Sharing Object Message Properties
                    // [MS-OXSHARE] 2.2.2.12
                    ExtendedPropertyDefinition PidLidSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.Binary);
                    // [MS-OXSHARE] 2.2.2.13
                    ExtendedPropertyDefinition PidNameXSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-GUID", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.14
                    ExtendedPropertyDefinition PidLidSharingProviderName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A02, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.15           
                    ExtendedPropertyDefinition PidNameXSharingProviderName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-Name", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.16
                    ExtendedPropertyDefinition PidLidSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A03, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.17
                    ExtendedPropertyDefinition PidNameXSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-URL", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.5
                    ExtendedPropertyDefinition PidLidSharingFlavor = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A18, MapiPropertyType.Integer);
                    // [MS-OXSHARE] 2.2.2.6
                    ExtendedPropertyDefinition PidNameXSharingFlavor = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Flavor", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.1
                    ExtendedPropertyDefinition PidLidSharingCapabilities = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A17, MapiPropertyType.Integer);
                    // [MS-OXSHARE] 2.2.2.2
                    ExtendedPropertyDefinition PidNameXSharingCapabilities = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Capabilities", MapiPropertyType.String);
                    // Sections 2.3 and 2.4 are also zero-length strings, so I won't set those either
                    // [MS-OXSHARE] 2.2.2.3
                    // ExtendedPropertyDefinition PidLidSharingConfigurationUrl = new   //ExtendedPropertyDefinition(PropertySetSharing, 0x8A24, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.4
                    //ExtendedPropertyDefinition PidNameXSharingConfigUrl = new //ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "X-Sharing-Config-Url", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.10
                    ExtendedPropertyDefinition PidLidSharingLocalType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A14, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.11
                    ExtendedPropertyDefinition PidNameXSharingLocalType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Local-Type", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.7
                    ExtendedPropertyDefinition PidLidSharingInitiatorEntryId = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A09, MapiPropertyType.Binary);
                    // [MS-OXSHARE] 2.2.2.8
                    ExtendedPropertyDefinition PidLidSharingInitiatorName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A07, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.9
                    ExtendedPropertyDefinition PidLidSharingInitiatorSMTP = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A08, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.1
                    ExtendedPropertyDefinition PidLidSharingRemoteName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A05, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.2 
                    ExtendedPropertyDefinition PidNameXSharingRemoteName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Name", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.5 
                    ExtendedPropertyDefinition PidLidSharingRemoteType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A1D, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.6 
                    ExtendedPropertyDefinition PidNameXSharingRemoteType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Type", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.7 
                    ExtendedPropertyDefinition PidLidSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A06, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.8 
                    ExtendedPropertyDefinition PidNameXSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Uid", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.3
                    ExtendedPropertyDefinition PidLidSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A48, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.4
                    ExtendedPropertyDefinition PidNameXSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Store-Uid", MapiPropertyType.String);
                    //From troubleshooting I noticed I was missing
                    ExtendedPropertyDefinition PidTagPriority = new ExtendedPropertyDefinition(0x0026, MapiPropertyType.Integer);
                    ExtendedPropertyDefinition PidTagSensitivity = new ExtendedPropertyDefinition(0x0036, MapiPropertyType.Integer);
                    ExtendedPropertyDefinition PR_BODY_HTML = new ExtendedPropertyDefinition(0x1013, MapiPropertyType.Binary); //PR_BOD
                    ExtendedPropertyDefinition PR_BODY = new ExtendedPropertyDefinition(0x1000, MapiPropertyType.String);
                    ExtendedPropertyDefinition RecipientReassignmentProhibited = new ExtendedPropertyDefinition(0x002b, MapiPropertyType.Boolean);
                    // Section 2.2.1
                    invitationRequest.SetExtendedProperty(PidTagNormalizedSubject, "I'd like to share my calendar with you"); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                    //invitationRequest.SetExtendedProperty(PidTagSubjectPrefix, String.Empty); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                    // Section 2.2.2
                    invitationRequest.SetExtendedProperty(PidLidSharingCapabilities, 0x40220); /* value for Special Folders */
                    invitationRequest.SetExtendedProperty(PidNameXSharingCapabilities, "40220"); /* Test representation of SharingCapabilities value */
                    //invitationRequest.SetExtendedProperty(PidLidSharingConfigurationUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.3 */
                    //invitationRequest.SetExtendedProperty(PidNameXSharingConfigUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.4 */
                    invitationRequest.SetExtendedProperty(PidLidSharingFlavor, 0x20310); /* Indicates Invitation for a special folder [MS-OXSHARE] 2.2.2.5 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingFlavor, "20310"); /* Text representation of SharingFlavor value [MS-OXSHARE] 2.2.2.6 */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorEntryId, byteEntryId); /* Value from the Initiator/EntryId value in the Sharing Message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorSMTP, "[email protected]"); /* Value from Initiator/Smtp Address in the Sharing message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorName, "User1"); /* Value from Initiator/Name Address in the Sharing message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingLocalType, "IPF.Appointment"); /* MUST be set to PidTagContainerClass of folder to be shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingLocalType, "IPF.Appointment"); /* MUST be set to same value as PidLidSharingLocalType */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderGuid, byteSharingProviderGuid); /* Constant Required Value [MS-OXSHARE] 2.2.2.12 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderGuid, "AEF0060000000000C000000000000046"); /* Constant Required Value [MS-OXSHARE] 2.2.2.13 */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.14 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.15] */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.16 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.17 */
                    // Section 2.2.3
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteName, calendar.FolderName); /* MUST be set to PidTagDisplayName of the folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteName, calendar.FolderName); /* MUST be set to same value as PidLidSharingRemoteName */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteStoreUid, mailboxId); /* Must be set to PidTagStoreEntryId of the folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteStoreUid, mailboxId); /* MUST be set to same value as PidLidSharingRemoteStoreUid */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.5 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.6 */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteUid, folderidHex); /* MUST be set to PidTagEntryId of folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteUid, folderidHex); /* Must be set to same value as PidLidSharingRemoteUid */
                    // Section 2.2.5
                    invitationRequest.SetExtendedProperty(PidNameContentClass, "Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                    invitationRequest.SetExtendedProperty(PidTagMessageClass, "IPM.Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                    // ********* ADDITIONAL MAPPED PROPERTIES IM FINDING AS I TROUBLESHOOT ********************** //
                    invitationRequest.SetExtendedProperty(PidTagPriority, 0); /* From troubleshooting I'm just trying to match up values that were missing */
                    invitationRequest.SetExtendedProperty(PidTagSensitivity, 0); /* From troubleshooting as well */
                    invitationRequest.SetExtendedProperty(PR_BODY_HTML, binPRBODYHTML); /* From troubleshooting OWA error pointing to serializing HTML failing */
                    invitationRequest.SetExtendedProperty(PR_BODY, strBODY);
                    invitationRequest.SetExtendedProperty(RecipientReassignmentProhibited, true); /* Because it seemed like a good idea */
                    // Add a file attachment by using a stream
                    // We need to do the following in order to prevent 3 extra bytes from being prepended to the attachment
                    string sharMetadata = File.ReadAllText(sharedFilePath, Encoding.ASCII);
                    byte[] fileContents;
                    UTF8Encoding encoding = new System.Text.UTF8Encoding();
                    fileContents = encoding.GetBytes(sharMetadata);
                    //fileContents = File.ReadAllBytes(sharedFilePath);
                    //// fileContents is a Stream object that represents the content of the file to attach.
                    invitationRequest.Attachments.AddFileAttachment("sharing_metadata.xml", fileContents);
                    ////invitationRequest.Attachments.AddFileAttachment(sharedFilePath);
                    //// This is where we set those "special" headers and other pertinent
                    //// information I noted in Part 1 of this series...
                    //Attachment thisAttachment = invitationRequest.Attachments[0];
                    //thisAttachment.ContentType = "application/x-sharing-metadata-xml";
                    //thisAttachment.Name = "sharing_metadata.xml";
                    //thisAttachment.IsInline = false;
                    // Add recipient info and send message
                    invitationRequest.ToRecipients.Add(new EmailAddress() { Address = "[email protected]" });
                    invitationRequest.SendAndSaveCopy();
                    // I always end my methods by returning the EWS 
                    // impersonated user to null to clean up
                    service.ImpersonatedUserId = null;
                catch (Exception ex)
            public String GetConvertedEWSIDinHex(ExchangeService esb, String sID, String strSMTPAdd)
                // Create a request to convert identifiers.
                AlternateId objAltID = new AlternateId();
                objAltID.Format = IdFormat.EwsId;
                objAltID.Mailbox = strSMTPAdd;
                objAltID.UniqueId = sID;
                //Convert  PR_ENTRYID identifier format to an EWS identifier.
                AlternateIdBase objAltIDBase = esb.ConvertId(objAltID, IdFormat.HexEntryId);
                AlternateId objAltIDResp = (AlternateId)objAltIDBase;
                return objAltIDResp.UniqueId.ToString();
            public String GetInvitationMailboxId(string mailBoxServer, string domainName)
                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
                service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
                // Generate The Store Entry Id for the impersonated user
                StringBuilder MailboxIDPointer = new StringBuilder();          
                string fqdn = mailBoxServer;
                string legacyDN = domainName;
                MailboxIDPointer.Append("00000000"); /* Flags */
                MailboxIDPointer.Append("38A1BB1005E5101AA1BB08002B2A56C2"); /* ProviderUID */
                MailboxIDPointer.Append("00"); /* Version */
                MailboxIDPointer.Append("00"); /* Flag */
                MailboxIDPointer.Append("454D534D44422E444C4C00000000"); /* DLLFileName */
                MailboxIDPointer.Append("00000000"); /* Wrapped Flags */
                MailboxIDPointer.Append("1B55FA20AA6611CD9BC800AA002FC45A"); /* WrappedProvider UID (Mailbox Store Object) */
                MailboxIDPointer.Append("0C000000"); /* Wrapped Type (Mailbox Store) */
                MailboxIDPointer.Append(ConvertStringToHex(fqdn)); /* ServerShortname (FQDN) */
                MailboxIDPointer.Append("00"); /* termination bit */
                MailboxIDPointer.Append(ConvertStringToHex(legacyDN)); /* Returns the userDN of the impersonated user */
                MailboxIDPointer.Append("00"); /* terminator bit */
                service.ImpersonatedUserId = null;
                return MailboxIDPointer.ToString();
            static bool RedirectionUrlValidationCallback(String redirectionUrl)
                bool redirectionValidated = false;
                if (redirectionUrl.Equals("https://SampleUrl/autodiscover/autodiscover.xml"))          
                    redirectionValidated = true;
                return redirectionValidated;
            public String GetIntiatorEntryID(string domainName)
                String result = String.Empty;
                //// Bind to EWS
                //ExchangeService service = ExchangeConnection.ExchangeService();
                //service.ImpersonatedUserId =
                //new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
                //// Get LegacyDN Using the function above this one 
                string sharedByLegacyDN = domainName;
                // A conversion function from earlier
                string legacyDNinHex = ConvertStringToHex(sharedByLegacyDN);
                StringBuilder addBookEntryId = new StringBuilder();
                addBookEntryId.Append("00000000"); /* Flags */
                addBookEntryId.Append("DCA740C8C042101AB4B908002B2FE182"); /* ProviderUID */
                addBookEntryId.Append("01000000"); /* Version */
                addBookEntryId.Append("00000000"); /* Type - 00 00 00 00  = Local Mail User */
                addBookEntryId.Append(legacyDNinHex); /* Returns the userDN of the impersonated user */
                addBookEntryId.Append("00"); /* terminator bit */
                result = addBookEntryId.ToString();
                //service.ImpersonatedUserId = null;
                return result;
            public string ConvertStringToHex(string input)
                // Take our input and break it into an array
                char[] arrInput = input.ToCharArray();
                String result = String.Empty;
                // For each set of characters
                foreach (char element in arrInput)
                    if (String.IsNullOrEmpty(result))
                        result = String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
                    else
                        result += String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
                return result.ToString();
     public string CreateSharingMessageAttachment(string folderid, string userSharing, string userSharingEntryID, string invitationMailboxID, string userSharedTo, string dataType, string calendarName)
                XmlDocument sharedMetadataXML = new XmlDocument();
                string sharedMetaDataFilePath = string.Empty;
                try
                    // Create a String that contains our new sharing_metadata.xml file
                    StringBuilder metadataString = new StringBuilder("<?xml version=\"1.0\"?>");              
                    metadataString.Append("<SharingMessage xmlns=\"http://schemas.microsoft.com/sharing/2008\">");
                    metadataString.Append("<DataType>" + dataType + "</DataType>");
                    metadataString.Append("<Initiator>");
                    metadataString.Append("<Name>" + userSharing + "</Name>");
                    metadataString.Append("<SmtpAddress>" + "[email protected]" + "</SmtpAddress><EntryId>" + userSharingEntryID.Trim());
                    metadataString.Append("</EntryId>");
                    metadataString.Append("</Initiator>");
                    metadataString.Append("<Invitation>");
                    metadataString.Append("<Title>" + calendarName + "</Title>");
                    metadataString.Append("<Providers>");
                    metadataString.Append("<Provider Type=\"ms-exchange-internal\" TargetRecipients=\"" + userSharedTo + "\">");
                    metadataString.Append("<FolderId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                    metadataString.Append(folderid);
                    metadataString.Append("</FolderId>");
                    metadataString.Append("<MailboxId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                    metadataString.Append(invitationMailboxID);
                    metadataString.Append("</MailboxId>");
                    metadataString.Append("</Provider>");
                    metadataString.Append("</Providers>");
                    metadataString.Append("</Invitation>");
                    metadataString.Append("</SharingMessage>");
                    sharedMetadataXML.LoadXml(metadataString.ToString());
                    string tempPath = System.IO.Path.GetTempPath();
                    sharedMetaDataFilePath = tempPath + "sharing_metadata.xml";
                    sharedMetadataXML.Save(sharedMetaDataFilePath);
                catch (Exception eg)
                    throw eg;               
                return sharedMetaDataFilePath;
            public Dictionary<string, string> GetUserSettings(AutodiscoverService autodiscoverService)
                GetUserSettingsResponse userresponse = autodiscoverService.GetUserSettings(
                    "[email protected]",
                    UserSettingName.UserDisplayName,
                    UserSettingName.InternalMailboxServerDN,
                    UserSettingName.UserDN
                Dictionary<string, string> myUserSettings = new Dictionary<string, string>();
                foreach (KeyValuePair<UserSettingName, Object> usersetting in userresponse.Settings)
                    if (usersetting.Key.ToString() == "InternalMailboxServerDN")
                        int lastIndexOfEqual = usersetting.Value.ToString().LastIndexOf("=");
                        string subString = usersetting.Value.ToString().Substring(lastIndexOfEqual + 1);
                        string value = subString;
                        myUserSettings.Add("InternalMailboxServer", value.ToString());
                    if (usersetting.Key.ToString() == "UserDisplayName")
                        string[] arrResult = usersetting.Value.ToString().Split('.');
                        myUserSettings.Add("UserDisplayName", arrResult[0].ToString());
                    if (usersetting.Key.ToString() == "UserDN")
                        string[] arrResult = usersetting.Value.ToString().Split('.');
                        myUserSettings.Add("UserDN", arrResult[0].ToString());
                return myUserSettings;
            private static byte[] HexStringToByteArray(string input)
                byte[] Bytes;
                int ByteLength;
                string HexValue = "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9|||||||\xA\xB\xC\xD\xE\xF";
                ByteLength = input.Length / 2;
                Bytes = new byte[ByteLength];
                for (int x = 0, i = 0; i < input.Length; i += 2, x += 1)
                    Bytes[x] = (byte)(HexValue[Char.ToUpper(input[i + 0]) - '0'] << 4);
                    Bytes[x] |= (byte)(HexValue[Char.ToUpper(input[i + 1]) - '0']);
                return Bytes;

    Hi,
    I'm trying to share a calendar through ews managed api v.2 and using exchange 2013 version.
    i'm preparing a shared calendar and providing values to extended properties .
    Here comes the problem when i'm trying to send the sharing request(email message) 
    The following is code snippet.
      public void ShareCalendar(Calendar calendar)
                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
                  service.Credentials = new NetworkCredential("user1", "password", "domain");
                service.Url = new Uri("https://sampleUrl/ews/exchange.asmx");
                try
                    // Bind to the folder
                    //Folder folderStoreInfo;
                    //folderStoreInfo = Folder.Bind(service, calendar.ExchangeId);
                    //string EwsID = folderStoreInfo.Id.UniqueId;
                    string EwsID = calendar.FolderExchangeId;
                    // The value of folderidHex will be what we need to use for the FolderId in the xml file
                    AutodiscoverService autoDiscover = new AutodiscoverService(ExchangeVersion.Exchange2013);
                    autoDiscover.Credentials =  new NetworkCredential("user1", "password", "domain");
                    autoDiscover.RedirectionUrlValidationCallback = RedirectionUrlValidationCallback;
                    Dictionary<string, string> userSettings = GetUserSettings(autoDiscover);
                    string folderidHex = GetConvertedEWSIDinHex(service, EwsID, "[email protected]");
                    string domainName = string.Empty;
                    string mailBoxServer = string.Empty;
                    string userName = string.Empty;
                    foreach (var item in userSettings)
                        switch (item.Key)
                            case "UserDN":
                                domainName = item.Value.ToString();
                                break;
                            case "InternalMailboxServer":
                                mailBoxServer = item.Value.ToString();
                                break;
                            case "UserDisplayName":
                                userName = item.Value.ToString();
                                break;
                    string entryId = GetIntiatorEntryID(domainName);
                    string mailboxId = GetInvitationMailboxId(mailBoxServer, domainName);
                    string sharedFilePath = CreateSharingMessageAttachment(folderidHex, userName, entryId, mailboxId, "[email protected]", "calendar", calendar.FolderName);
                    // Create a new message
                    EmailMessage invitationRequest = new EmailMessage(service);
                    invitationRequest.Subject = "I'd like to share my calendar with you";
                    invitationRequest.Body = "Sent by Exchange Administrator on behalf of user";                
                    //invitationRequest.Culture = "en-US";
                    invitationRequest.Sensitivity = Sensitivity.Normal;
                    // Set a sharing specific property on the message
                    invitationRequest.ItemClass = "IPM.Sharing"; /* Constant Required Value [MS-ProtocolSpec] */
                    byte[] byteEntryId = HexStringToByteArray(entryId);
                    // This is the Guid of the Sharing Provider in Exchange, and it's value does not change
                    Guid binSharingProviderGuid = new Guid("{AEF00600-0000-0000-C000-000000000046}");
                    // Even though I don't think setting this property is mandatory, 
                    // it just seemed like the right thing to do and it works so I \
                    // ain't messin with it!                                        
                    byte[] byteSharingProviderGuid = binSharingProviderGuid.ToByteArray();
                    string strPRBODYHTML = "<html dir=\"ltr\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n<meta name=\"GENERATOR\"
    content=\"MSHTML 8.00.7601.17514\">\r\n<style id=\"owaParaStyle\">P {\r\n   MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px \r\n}\r\n</style>\r\n</head>\r\n<body fPStyle=\"1\" ocsi=\"0\">\r\n<tt>\r\n<pre>SharedByUserDisplayName
    (SharedByUserSmtpAddress) has invited you to view his or her Microsoft Exchange Calendar.\r\n\r\nFor instructions on how to view shared folders on Exchange, see the following article:\r\n\r\nhttp://go.microsoft.com/fwlink/?LinkId=57561\r\n\r\n*~*~*~*~*~*~*~*~*~*\r\n\r\n</pre>\r\n</tt>\r\n<div>\r\n<div
    style=\"direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;\">this is a test message</div>\r\n</div>\r\n</body>\r\n</html>\r\n";
                    string strBODY = @"
    SharedByUserDisplayName (SharedByUserSmtpAddress) has invited you to view his or
    her Microsoft Exchange Calendar.
    For instructions on how to view shared folders on Exchange, see the
    following article:
    http://go.microsoft.com/fwlink/?LinkId=57561
    *~*~*~*~*~*~*~*~*~*
    test body
                    // Convert these to hex and binary equivelants to assign to their relevant
                    // extended properties
                    string hexPRBODYHTML = ConvertStringToHex(strPRBODYHTML);
                    byte[] binPRBODYHTML = HexStringToByteArray(hexPRBODYHTML);
                    Guid PropertySetSharing = Guid.Parse("00062040-0000-0000-C000-000000000046");//constant 
                    Guid PropertySetInternetHeaders = Guid.Parse("00020386-0000-0000-C000-000000000046");//constant
                    ExtendedPropertyDefinition PidLidSharingProviderGuidProperty = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.CLSID);
                    ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
                    // Sharing Properties (in order of reference according to protocol examples in: [MS-OXSHARE])
                    // Additional Property Constraints
                    // [MS-OXSHARE] 2.2.5.2
                    ExtendedPropertyDefinition PidTagMessageClass = new ExtendedPropertyDefinition(0x001A, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.5.1
                    //ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "Content-Class", MapiPropertyType.String);
                    ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "Content-class", MapiPropertyType.String);
                    // Common Message Object Properties               
                    // [MS-OXSHARE] 2.2.1
                    ExtendedPropertyDefinition PidTagNormalizedSubject = new ExtendedPropertyDefinition(0x0E1D, MapiPropertyType.String);
                    // The PidTagSubjectPrefix is a zero-length string, so I do not set it
                    // ExtendedPropertyDefinition PidTagSubjectPrefix = new ExtendedPropertyDefinition(0x003D, MapiPropertyType.String);
                    // Sharing Object Message Properties
                    // [MS-OXSHARE] 2.2.2.12
                    ExtendedPropertyDefinition PidLidSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.Binary);
                    // [MS-OXSHARE] 2.2.2.13
                    ExtendedPropertyDefinition PidNameXSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-GUID", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.14
                    ExtendedPropertyDefinition PidLidSharingProviderName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A02, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.15           
                    ExtendedPropertyDefinition PidNameXSharingProviderName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-Name", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.16
                    ExtendedPropertyDefinition PidLidSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A03, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.17
                    ExtendedPropertyDefinition PidNameXSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-URL", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.5
                    ExtendedPropertyDefinition PidLidSharingFlavor = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A18, MapiPropertyType.Integer);
                    // [MS-OXSHARE] 2.2.2.6
                    ExtendedPropertyDefinition PidNameXSharingFlavor = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Flavor", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.1
                    ExtendedPropertyDefinition PidLidSharingCapabilities = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A17, MapiPropertyType.Integer);
                    // [MS-OXSHARE] 2.2.2.2
                    ExtendedPropertyDefinition PidNameXSharingCapabilities = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Capabilities", MapiPropertyType.String);
                    // Sections 2.3 and 2.4 are also zero-length strings, so I won't set those either
                    // [MS-OXSHARE] 2.2.2.3
                    // ExtendedPropertyDefinition PidLidSharingConfigurationUrl = new   //ExtendedPropertyDefinition(PropertySetSharing, 0x8A24, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.4
                    //ExtendedPropertyDefinition PidNameXSharingConfigUrl = new //ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "X-Sharing-Config-Url", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.10
                    ExtendedPropertyDefinition PidLidSharingLocalType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A14, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.11
                    ExtendedPropertyDefinition PidNameXSharingLocalType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Local-Type", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.7
                    ExtendedPropertyDefinition PidLidSharingInitiatorEntryId = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A09, MapiPropertyType.Binary);
                    // [MS-OXSHARE] 2.2.2.8
                    ExtendedPropertyDefinition PidLidSharingInitiatorName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A07, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.2.9
                    ExtendedPropertyDefinition PidLidSharingInitiatorSMTP = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A08, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.1
                    ExtendedPropertyDefinition PidLidSharingRemoteName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A05, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.2 
                    ExtendedPropertyDefinition PidNameXSharingRemoteName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Name", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.5 
                    ExtendedPropertyDefinition PidLidSharingRemoteType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A1D, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.6 
                    ExtendedPropertyDefinition PidNameXSharingRemoteType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Type", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.7 
                    ExtendedPropertyDefinition PidLidSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A06, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.8 
                    ExtendedPropertyDefinition PidNameXSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Uid", MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.3
                    ExtendedPropertyDefinition PidLidSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A48, MapiPropertyType.String);
                    // [MS-OXSHARE] 2.2.3.4
                    ExtendedPropertyDefinition PidNameXSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Store-Uid", MapiPropertyType.String);
                    //From troubleshooting I noticed I was missing
                    ExtendedPropertyDefinition PidTagPriority = new ExtendedPropertyDefinition(0x0026, MapiPropertyType.Integer);
                    ExtendedPropertyDefinition PidTagSensitivity = new ExtendedPropertyDefinition(0x0036, MapiPropertyType.Integer);
                    ExtendedPropertyDefinition PR_BODY_HTML = new ExtendedPropertyDefinition(0x1013, MapiPropertyType.Binary); //PR_BOD
                    ExtendedPropertyDefinition PR_BODY = new ExtendedPropertyDefinition(0x1000, MapiPropertyType.String);
                    ExtendedPropertyDefinition RecipientReassignmentProhibited = new ExtendedPropertyDefinition(0x002b, MapiPropertyType.Boolean);
                    // Section 2.2.1
                    invitationRequest.SetExtendedProperty(PidTagNormalizedSubject, "I'd like to share my calendar with you"); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                    //invitationRequest.SetExtendedProperty(PidTagSubjectPrefix, String.Empty); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                    // Section 2.2.2
                    invitationRequest.SetExtendedProperty(PidLidSharingCapabilities, 0x40220); /* value for Special Folders */
                    invitationRequest.SetExtendedProperty(PidNameXSharingCapabilities, "40220"); /* Test representation of SharingCapabilities value */
                    //invitationRequest.SetExtendedProperty(PidLidSharingConfigurationUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.3 */
                    //invitationRequest.SetExtendedProperty(PidNameXSharingConfigUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.4 */
                    invitationRequest.SetExtendedProperty(PidLidSharingFlavor, 0x20310); /* Indicates Invitation for a special folder [MS-OXSHARE] 2.2.2.5 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingFlavor, "20310"); /* Text representation of SharingFlavor value [MS-OXSHARE] 2.2.2.6 */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorEntryId, byteEntryId); /* Value from the Initiator/EntryId value in the Sharing Message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorSMTP, "[email protected]"); /* Value from Initiator/Smtp Address in the Sharing message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingInitiatorName, "User1"); /* Value from Initiator/Name Address in the Sharing message attachment .xml document */
                    invitationRequest.SetExtendedProperty(PidLidSharingLocalType, "IPF.Appointment"); /* MUST be set to PidTagContainerClass of folder to be shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingLocalType, "IPF.Appointment"); /* MUST be set to same value as PidLidSharingLocalType */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderGuid, byteSharingProviderGuid); /* Constant Required Value [MS-OXSHARE] 2.2.2.12 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderGuid, "AEF0060000000000C000000000000046"); /* Constant Required Value [MS-OXSHARE] 2.2.2.13 */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.14 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.15] */
                    invitationRequest.SetExtendedProperty(PidLidSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.16 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.17 */
                    // Section 2.2.3
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteName, calendar.FolderName); /* MUST be set to PidTagDisplayName of the folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteName, calendar.FolderName); /* MUST be set to same value as PidLidSharingRemoteName */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteStoreUid, mailboxId); /* Must be set to PidTagStoreEntryId of the folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteStoreUid, mailboxId); /* MUST be set to same value as PidLidSharingRemoteStoreUid */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.5 */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.6 */
                    invitationRequest.SetExtendedProperty(PidLidSharingRemoteUid, folderidHex); /* MUST be set to PidTagEntryId of folder being shared */
                    invitationRequest.SetExtendedProperty(PidNameXSharingRemoteUid, folderidHex); /* Must be set to same value as PidLidSharingRemoteUid */
                    // Section 2.2.5
                    invitationRequest.SetExtendedProperty(PidNameContentClass, "Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                    invitationRequest.SetExtendedProperty(PidTagMessageClass, "IPM.Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                    // ********* ADDITIONAL MAPPED PROPERTIES IM FINDING AS I TROUBLESHOOT ********************** //
                    invitationRequest.SetExtendedProperty(PidTagPriority, 0); /* From troubleshooting I'm just trying to match up values that were missing */
                    invitationRequest.SetExtendedProperty(PidTagSensitivity, 0); /* From troubleshooting as well */
                    invitationRequest.SetExtendedProperty(PR_BODY_HTML, binPRBODYHTML); /* From troubleshooting OWA error pointing to serializing HTML failing */
                    invitationRequest.SetExtendedProperty(PR_BODY, strBODY);
                    invitationRequest.SetExtendedProperty(RecipientReassignmentProhibited, true); /* Because it seemed like a good idea */
                    // Add a file attachment by using a stream
                    // We need to do the following in order to prevent 3 extra bytes from being prepended to the attachment
                    string sharMetadata = File.ReadAllText(sharedFilePath, Encoding.ASCII);
                    byte[] fileContents;
                    UTF8Encoding encoding = new System.Text.UTF8Encoding();
                    fileContents = encoding.GetBytes(sharMetadata);
                    //fileContents = File.ReadAllBytes(sharedFilePath);
                    //// fileContents is a Stream object that represents the content of the file to attach.
                    invitationRequest.Attachments.AddFileAttachment("sharing_metadata.xml", fileContents);
                    ////invitationRequest.Attachments.AddFileAttachment(sharedFilePath);
                    //// This is where we set those "special" headers and other pertinent
                    //// information I noted in Part 1 of this series...
                    //Attachment thisAttachment = invitationRequest.Attachments[0];
                    //thisAttachment.ContentType = "application/x-sharing-metadata-xml";
                    //thisAttachment.Name = "sharing_metadata.xml";
                    //thisAttachment.IsInline = false;
                    // Add recipient info and send message
                    invitationRequest.ToRecipients.Add(new EmailAddress() { Address = "[email protected]" });
                    invitationRequest.SendAndSaveCopy();
                    // I always end my methods by returning the EWS 
                    // impersonated user to null to clean up
                    service.ImpersonatedUserId = null;
                catch (Exception ex)
            public String GetConvertedEWSIDinHex(ExchangeService esb, String sID, String strSMTPAdd)
                // Create a request to convert identifiers.
                AlternateId objAltID = new AlternateId();
                objAltID.Format = IdFormat.EwsId;
                objAltID.Mailbox = strSMTPAdd;
                objAltID.UniqueId = sID;
                //Convert  PR_ENTRYID identifier format to an EWS identifier.
                AlternateIdBase objAltIDBase = esb.ConvertId(objAltID, IdFormat.HexEntryId);
                AlternateId objAltIDResp = (AlternateId)objAltIDBase;
                return objAltIDResp.UniqueId.ToString();
            public String GetInvitationMailboxId(string mailBoxServer, string domainName)
                ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
                service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
                // Generate The Store Entry Id for the impersonated user
                StringBuilder MailboxIDPointer = new StringBuilder();          
                string fqdn = mailBoxServer;
                string legacyDN = domainName;
                MailboxIDPointer.Append("00000000"); /* Flags */
                MailboxIDPointer.Append("38A1BB1005E5101AA1BB08002B2A56C2"); /* ProviderUID */
                MailboxIDPointer.Append("00"); /* Version */
                MailboxIDPointer.Append("00"); /* Flag */
                MailboxIDPointer.Append("454D534D44422E444C4C00000000"); /* DLLFileName */
                MailboxIDPointer.Append("00000000"); /* Wrapped Flags */
                MailboxIDPointer.Append("1B55FA20AA6611CD9BC800AA002FC45A"); /* WrappedProvider UID (Mailbox Store Object) */
                MailboxIDPointer.Append("0C000000"); /* Wrapped Type (Mailbox Store) */
                MailboxIDPointer.Append(ConvertStringToHex(fqdn)); /* ServerShortname (FQDN) */
                MailboxIDPointer.Append("00"); /* termination bit */
                MailboxIDPointer.Append(ConvertStringToHex(legacyDN)); /* Returns the userDN of the impersonated user */
                MailboxIDPointer.Append("00"); /* terminator bit */
                service.ImpersonatedUserId = null;
                return MailboxIDPointer.ToString();
            static bool RedirectionUrlValidationCallback(String redirectionUrl)
                bool redirectionValidated = false;
                if (redirectionUrl.Equals("https://SampleUrl/autodiscover/autodiscover.xml"))          
                    redirectionValidated = true;
                return redirectionValidated;
            public String GetIntiatorEntryID(string domainName)
                String result = String.Empty;
                //// Bind to EWS
                //ExchangeService service = ExchangeConnection.ExchangeService();
                //service.ImpersonatedUserId =
                //new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
                //// Get LegacyDN Using the function above this one 
                string sharedByLegacyDN = domainName;
                // A conversion function from earlier
                string legacyDNinHex = ConvertStringToHex(sharedByLegacyDN);
                StringBuilder addBookEntryId = new StringBuilder();
                addBookEntryId.Append("00000000"); /* Flags */
                addBookEntryId.Append("DCA740C8C042101AB4B908002B2FE182"); /* ProviderUID */
                addBookEntryId.Append("01000000"); /* Version */
                addBookEntryId.Append("00000000"); /* Type - 00 00 00 00  = Local Mail User */
                addBookEntryId.Append(legacyDNinHex); /* Returns the userDN of the impersonated user */
                addBookEntryId.Append("00"); /* terminator bit */
                result = addBookEntryId.ToString();
                //service.ImpersonatedUserId = null;
                return result;
            public string ConvertStringToHex(string input)
                // Take our input and break it into an array
                char[] arrInput = input.ToCharArray();
                String result = String.Empty;
                // For each set of characters
                foreach (char element in arrInput)
                    if (String.IsNullOrEmpty(result))
                        result = String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
                    else
                        result += String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
                return result.ToString();
     public string CreateSharingMessageAttachment(string folderid, string userSharing, string userSharingEntryID, string invitationMailboxID, string userSharedTo, string dataType, string calendarName)
                XmlDocument sharedMetadataXML = new XmlDocument();
                string sharedMetaDataFilePath = string.Empty;
                try
                    // Create a String that contains our new sharing_metadata.xml file
                    StringBuilder metadataString = new StringBuilder("<?xml version=\"1.0\"?>");              
                    metadataString.Append("<SharingMessage xmlns=\"http://schemas.microsoft.com/sharing/2008\">");
                    metadataString.Append("<DataType>" + dataType + "</DataType>");
                    metadataString.Append("<Initiator>");
                    metadataString.Append("<Name>" + userSharing + "</Name>");
                    metadataString.Append("<SmtpAddress>" + "[email protected]" + "</SmtpAddress><EntryId>" + userSharingEntryID.Trim());
                    metadataString.Append("</EntryId>");
                    metadataString.Append("</Initiator>");
                    metadataString.Append("<Invitation>");
                    metadataString.Append("<Title>" + calendarName + "</Title>");
                    metadataString.Append("<Providers>");
                    metadataString.Append("<Provider Type=\"ms-exchange-internal\" TargetRecipients=\"" + userSharedTo + "\">");
                    metadataString.Append("<FolderId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                    metadataString.Append(folderid);
                    metadataString.Append("</FolderId>");
                    metadataString.Append("<MailboxId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                    metadataString.Append(invitationMailboxID);
                    metadataString.Append("</MailboxId>");
                    metadataString.Append("</Provider>");
                    metadataString.Append("</Providers>");
                    metadataString.Append("</Invitation>");
                    metadataString.Append("</SharingMessage>");
                    sharedMetadataXML.LoadXml(metadataString.ToString());
                    string tempPath = System.IO.Path.GetTempPath();
                    sharedMetaDataFilePath = tempPath + "sharing_metadata.xml";
                    sharedMetadataXML.Save(sharedMetaDataFilePath);
                catch (Exception eg)
                    throw eg;               
                return sharedMetaDataFilePath;
            public Dictionary<string, string> GetUserSettings(AutodiscoverService autodiscoverService)
                GetUserSettingsResponse userresponse = autodiscoverService.GetUserSettings(
                    "[email protected]",
                    UserSettingName.UserDisplayName,
                    UserSettingName.InternalMailboxServerDN,
                    UserSettingName.UserDN
                Dictionary<string, string> myUserSettings = new Dictionary<string, string>();
                foreach (KeyValuePair<UserSettingName, Object> usersetting in userresponse.Settings)
                    if (usersetting.Key.ToString() == "InternalMailboxServerDN")
                        int lastIndexOfEqual = usersetting.Value.ToString().LastIndexOf("=");
                        string subString = usersetting.Value.ToString().Substring(lastIndexOfEqual + 1);
                        string value = subString;
                        myUserSettings.Add("InternalMailboxServer", value.ToString());
                    if (usersetting.Key.ToString() == "UserDisplayName")
                        string[] arrResult = usersetting.Value.ToString().Split('.');
                        myUserSettings.Add("UserDisplayName", arrResult[0].ToString());
                    if (usersetting.Key.ToString() == "UserDN")
                        string[] arrResult = usersetting.Value.ToString().Split('.');
                        myUserSettings.Add("UserDN", arrResult[0].ToString());
                return myUserSettings;
            private static byte[] HexStringToByteArray(string input)
                byte[] Bytes;
                int ByteLength;
                string HexValue = "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9|||||||\xA\xB\xC\xD\xE\xF";
                ByteLength = input.Length / 2;
                Bytes = new byte[ByteLength];
                for (int x = 0, i = 0; i < input.Length; i += 2, x += 1)
                    Bytes[x] = (byte)(HexValue[Char.ToUpper(input[i + 0]) - '0'] << 4);
                    Bytes[x] |= (byte)(HexValue[Char.ToUpper(input[i + 1]) - '0']);
                return Bytes;
    am i missing anything 
    any help is appreciated 
    Thanks in advance

  • EWS Managed API - 1. BindToItems returns ErrorAccessDenied error, 2. appointments created in one mailbox show up in others

    Hi,
    I know there are other questions about ErrorAccessDenied but they are not exactly describing my situation and all are pretty much old and mostly not answered so forgive me for creating my own.
    Also, wall of text coming so please bear with me.
    We have an application that synchronizes Exchange items into our internal systems. Items created on Exchange are stored in that system and vice versa of course with a lot of business logic and rules, etc. Application uses EWS Managed API and impersonation
    to access users mailboxes. Everything works fine but now we have this one customer that has a lot of strange things going on with main 2 problems mentioned in subject.
    1. To ensure both sides (Exchange and our system) are in sync we have a functionality that allows users to decide that items no longer existing on Exchange should be removed also from system database. Since in our record we store id of original Exchange
    item internal system simply sends us list of those ids to confirm items still exist. What application does is a BindToItems method call with BasePropertySet.IdOnly as requested property and depending on server response we notify internal system about state
    of items. There is some semi complex logic behind what exactly is done on system side but in general NoError and item returned means item exists, ErrorItemNotFound means item doesn't exist.
    For this one customer suddenly we started to receive ErrorAccessDenied and ErrorBatchProcessingStopped error codes which is very strange because seconds earlier there were events read from PullSubscribtion, items read from server, items created on server
    and bunch of other stuff going on which basically makes me sure that impersonation is working. For some reason during execution of this particular code ErrorAccesDenied is returned and it messes up whole BindToItems call.
    But what is really strange is that for first id in list of ids we get NoError and correct item returned, for second id we get ErrorAccessDenied, and rest of responses is ErrorBatchProcessingStopped. So is it really about credentials or there is some
    completely different reason AccessDenied is retuned? According to customer those items exist in user mailbox for whom those errors are showing up. It doesn't happen for all users, only for some - who have exactly the same configuration of mailboxes as rest
    (according to customer).
    2. For same customer another problem started to occur since 1st of January, at least that is a date when they noticed it for the first time. Again, it happens for some users and there is no scenario that would guarantee to reproduce it.
    When new record is created in our system or its data change it has to be created/updated on Exchange. With same impersonation as for problem described above I simply create new item or find existing item using id provided by our system, set item properties
    according to whatever was sent and save/update item on Exchange. Simple and it works in multiple installations without problems.
    But this customer reports that appointments created for one user show up in other users mailboxes which I find really strange because as far as I know when I impersonate [email protected] everything I do is executed in context of this one user only. So if
    I create appointment in his calendar I cannot create same appointment in userB's calendar without explicitly switching impersonation to userB. What is worth mentioning during our sync process we store on Exchange items bunch of custom properties that help
    us verify whole process and do various filters, etc. All of those custom properties are visible in outlook in that design form view or whatever it is called. And I have screenshot from user that claims to have one of those "not his" appointments
    and basically half of our properties is not there and some have no values while they definitely should have otherwise whole sync would fail and everything is logged as successful.
    Sorry for this wall of text but I really have no idea what can causing those strange problems so I tried to describe as much as possible without breaching NDA and such stuff. We added a lot of logging around areas where impersonation is changed, Exchange
    items are created/updated, etc. Logs show nothing, of course.
    So, for first issue: is it possible that items were moved on Exchange in such way that user still can see them but for EWS API call we get ErrorAccessDenied? I'm not sure where exactly could be such location because if id of an item would change we should
    rather get ErrorItemNotFound or even something about id being not properly formatted, right?
    For second issue: is it possible that there is something running on Exchange server and does some kind of simplistic mirroring of items between mailboxes? Customer claims there are no such things on server nor user side but can it be something that non-IT
    people wouldn't know? Like some kind of script that admins like to run to keep server healthy or something innocent but lethal for our scenarios? Anybody has any hints what we should even ask customer about to get closer to solution of those mysterious problems?

    Were you able to figure what was going on with your first problem? we're seeing the exact same issue with one of our customers.

  • [svn] 2700: With the Marshal Plan, when create an instance of a manager, we need to talk to the system manager.

    Revision: 2700
    Author: [email protected]
    Date: 2008-07-31 21:12:03 -0700 (Thu, 31 Jul 2008)
    Log Message:
    With the Marshal Plan, when create an instance of a manager, we need to talk to the system manager. Unfortunately sometimes these manager instances can be created before the Application class is created and/or before the systemManager property is set on the application. So to get the reference to the system manager from the manager instances, we can't use ApplicationGlobals.application.systemManager. We need to use SystemManagerGlobals.topLevelSystemManagers[0] instead. This property is set in the SystemManager constructor, and fortunately for us, Flash runs your root display object's constructor before anything else, even before static initializers (atleast ones not defined in SystemManager or a dependency of it).
    QE: Yes
    Doc: No
    Bugs: SDK-16207, SDK-16208, SDK-16209
    Reviewer: Alex
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-16207
    http://bugs.adobe.com/jira/browse/SDK-16208
    http://bugs.adobe.com/jira/browse/SDK-16209
    Modified Paths:
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.a s
    flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl. as

    an instance p for Point class is created like this?
    Instead we can create and instance of Point class
    as:
    Point p = new Point();
    Can any one of you explain this?Your Point() constructor doesn't throw exceptions, so there's no need to catch them. The Class.forName() and Class.getInstance() methods can throw exceptions, so it's necessary to handle them if they arise. Check out the docs for those methods, it lists what exceptions they can throw.
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#forName(java.lang.String)
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#newInstance()
    2) In the above Class Point what is the use of
    creating an instance of Point with in that Point
    class?
    static Point origin = new Point(0,0);
    What the reason to create an instance like this
    within the same class. We can create this instance of
    point
    class when ever we need. There doesn't seem to be any in your code, since that variable is never accessed. It could be useful if you wanted to have a Point that was shared across all instances. This is not a good example of that though.

  • Work Manager API in Sun Java Application Server 8.1

    I am trying to build a parallel application using Work Manager api (javax.resource.spi.work.WorkManager;)
    I studied the Websphere implementation of WorkManager there you need to make JNDI lookup for work manager and then use it to submit the work.
    My question is if i make class which will implement the javax.resource.spi.work.WorkManager; interface and use that class to submit the work and execute it in parallel then will that class will handle the resource management and all j2ee services
    Do we have separate implementation of work manager API for Sun Java Application Server 8.1 (any jar like asynch.jar in IBM websphere) so that we will just create a work manager using admin console and make JNDI lookup and use it
    Please guide me

    Before I start, disclaimer -- I have no knowledge of Hibernate and the following comments are based on the stack trace you have included.
    I think your permissions might be set all right but you might have an error in the hibernate query. It looks like hibernate uses antlr to parse the queries. While parsing the query, antlr is encountering an exceptional condition and is trying to exit the VM (by calling System.exit()). Obviously, the hibernate code does not have that permission and therefore the exception is logged.
    My guess is if you fix the query such that hibernate/antlr can parse it, you will not run into this error.
    Hope this helps,

  • System monitoring API needed

    Hi all,
    I have a requirement in which I need to monitor all the system parameters like processor usage, free RAM etc. from within my java application. Is there any open source JNI based API for that? I dont know much of c/c++ and thus can't code my own. Its really urgent. So help me please.

    Hi all,
    What I wanted was to profile the system on which my application is running, not my own application. So I guess I cant use the JProbe. As for the managment API I am supposed to use the 1.4 version only. So I cant use those API's too. The problem is solved now. I wrote my own wrapper for the getting the all the information on the PC.
    Anyway, thank you all.

  • Policy Manager API - The AccessGate is unable to contact any Access Servers

    Hello all,
    I am trying some samples to connect to OAM using policy manager api.
    I have the below mentioned code
    ObAccessManager am = new ObAccessManager();
    ObConfig.initialize();
    am.setAdmin("orcladmin", "welcome1");
    But when I run this code, I get an exception saying
    com.oblix.access.ObAccessException: The AccessGate is unable to contact any Access Servers.
    I have included AccessServerSDK paths in PATH,CLASSPATH and OBACCESS_INSTALL_DIR variables.
    and my ObAccessClient.xml file access server entry is as below
    <ValNameList
    xmlns="http://www.oblix.com"
    ListName="server1">
    <NameValPair
    ParamName="host"
    Value="son1891"></NameValPair>
    <NameValPair
    ParamName="port"
    Value="6035"></NameValPair>
    <NameValPair
    ParamName="numOfConnections"
    Value="1"></NameValPair>
    </ValNameList>
    I have spent a complete day on this, but still do not have a clue what is wrong.
    Please help me to solve this.
    Thanks
    Roopa.

    Ensure you have the following Env Var's set:
    CLASSPATH to \AccessServerSDK\oblix\lib\jobaccess.jar
    LD_LIBRARY_PATH to \AccessServerSDK\oblix\lib
    OBACCESS_INSTALL_DIR to \AccessServerSDK
    PATH to \AccessServerSDK\oblix\lib; \AccessServerSDK\oblix\tools
    POST_CLASSPATH to \AccessServerSDK\oblix\lib\jobaccess.jar
    In your AccessGate Definition, did you set the Access Management Service to On? The Communication Modes should be same for all the components. Also mind the time difference between all the systems. Anyway - May I know the objective behind the work with Policy Manager API ? Are you building a custom UI ?

  • EWS Managed API: Email sender name incorrect if loading properties of multiple emails and several emails have same email address (but different names)

    Hi,
    I have an issue using the Exchange Web Services Managed API. I'm essentially implementing an 'inbox', and am essentially using two calls:
    folder.FindItems(filter, view) with the view set up with the 'idonly' property.
    The returns a 'FindItemResults<>' object containing a set of items.
    And then calling service.LoadPropertiesForItems(items, props), where the props contains all 'first class properties', which includes the sender details.
    Now, the inbox contains several emails from the same email address but with different displaynames.
    E.g. There may be one email from "Bob <[email protected]>" and another email from "Alice <[email protected]>" and another email from "Charlie <[email protected]>" etc.
    The issue is that in the information that EWS returns from the call to LoadPropertiesForItems, every email ends up with the same sender name (from the first one in the list)!
    i.e. When I enumerate through the returned items, the item.Sender.Name will always be"Bob" for every email where Sender.Address is [email protected] 
    I have debugged this with a http sniffer just to ensure that it really is the EWS coming back with this information rather than anything in the managed layer.
    Is this a known issue? How can I work around this (without querying every single email for the sender name individually, as that would be too slow)?
    Thanks

    Hi Venkat,
    Thanks for the reply.
    The scenario is that the client receives emails from a (3rd-party) automated system. The email address from this automated system is always "noreply@<blah.com>", while the display name is used to differentiate the actual sender.
    I suspect that this kind of system will likely become more widely used, and so for us will increase in priority (obviously its a priority for our client already)!
    Just for the record, if this is a known issue do you have a bug number or equivalent for it? (I tried to search but couldn't locate it).

  • New to System Manager - Advise needed on my requirements

    Hi there!
    I am very new to System Manager 2012, so I am seeking advise on how to best start my project. I read the initial part of the Getting Started guide ( http://technet.microsoft.com/library/dn235548.aspx ), but System Manager is a big product so I need
    to double check the direction I should take, based on my design requirements.
    So here is what I am trying to achieve in two bullet points:
    - I got my own monitoring system application that I can query via an API. The API is REST based (i.e. HTTP GET/POST operations) and I already wrote a Python script to query my API so I can export data and alerts from it.
    - I'd like to integrate the data/alerts coming from my own monitoring application into the Microsoft System center.
    Questions:
    1) in the first page of the Getting Started guide, I can see I am offered the option to download several evaluation virtual hard disks (e.g. App Controller, Operation Manager, Service Manager, Orchestrator, Virtual Machine Manager). Not sure which one I
    should use for what I am trying to achieve?
    2) depending on the component picked in point (1), what's the best documentation link to start studying how the Microsoft application works, and how to integrate the data coming from my API?
    3) is my Python script fine to run on the Microsoft Virtual Machine, in order to query my API and pass the data to the System Manager 2012?
    Thanks in advance for your help, and looking forward to actively join your community!
    Wally

    The system center suite contains several products.
    For monitoring purposes you should look into the Operations Manager product.
    Have a look here for details on OpsMgr:
    http://technet.microsoft.com/en-us/library/hh509025.aspx.
    These forums are specifically for Configuration Manager.
    Tim | Blog |
    @Tim_DK

  • Accessing the user management API programmatically

    I am looking for the officially supported method that could be used to access the user management API via "curl" for CRX:
    There is a user management API described here:
    http://sling.apache.org/site/managing-users-and-groups-jackrabbitusermanager.html
    However, executing a command on CRX 2.2 such as:
    curl -u:admin:admin http://localhost:7402/system/userManager/user.tidy.1.json
    Only returns a message indicating that the contents have been redirected (without providing another URL).
    Using the Content Explorer in CRX shows the list of users at: /home/users but I am not sure if a curl command could access the user list via that URL.
    Any pointers on how this could be done are appreciated.  This is for a partner.
    Regards,
    Blair

    I am a co-worker of MorrellJ.  I am trying to do a change password request using the Jackrabbit User Manager with the REST URL /system/userManager/user/<username>.changePassword.json.  The problem I am having is that this request requires an oldPwd form param in the request.  The issue is that when I am trying to do this request it is in response to the user selecting "Forgot Password" so our logic has created a random password which we then email to the user so they can use that the next time they want to login.  We need to change that user's password in CRX so they can log in using it next time.  Since they haven't logged in there is no session, NOT the problem.  THE PROBLEMS, I don't know 1. how to use the userManager to get that user's old password, since /system/userManager/user/<username>.json doesn't appear to return the password and 2. if I could get the old password it most certainly will be encoded, some how, so I will need some decoding algorithm to pass it through in order to get the actual password to set as the oldPwd form param to my change password request.  Please let me know if you require any further explanation.  Any assistance would be greatly appreciated.  Thank you, in advance, for your assistance.
    Sincerely,
    Mike Sucena
    [email protected]

  • Use oes management api get "No privilege" error

    Hi all,
    i try to use oes management api to manage my application's entitlements.
    but while i coding get a “No privilege” error , any suggest ?
    regards
    java code:
    RBAC_Manager mgr = null;
    RBAC_Context rbacCtx = null;
    mgr = new RBAC_Manager(new URL("https://10.1.18.4:7011/servlet/AxisServlet/blm"),"admin","password");
    rbacCtx = mgr.createContext();
    System.out.println("user -> " + rbacCtx.getLoginUser());
    ScopeManager scopeMgr = rbacCtx.getScopeManager();
    Organization o = scopeMgr.getRoot();
    rbacCtx.setScope(o);
    Scope s = rbacCtx.getScope();
    s = scopeMgr.getScope("ejianlong");
    rbacCtx.setScope(s);
    scopeMgr = rbacCtx.getScopeManager();
    scopeMgr.createApplication("jlerp_a");output:
    user -> //user/RootOrg!AdminDir/admin/
    com.bea.ales.management.exception.ManagementException: No privilege to create Application jlerp_a under RootOrg!ejianlong
         at com.bea.ales.management.ScopeManager.createApplication(ScopeManager.java:156)
         at com.jl.test.model.Class1.main(Class1.java:36)Edited by: Lighting Cui on 2011-9-12 下午5:34

    Have worked it out...
    In case anyone else has the same thing happening, the issue was with the external hard drive. I had read-only privileges while it was connected to my new MacBook. It's a Seagate GoFlex. Had to download the NTFS for Mac driver from their website
    http://www.seagate.com/au/en/support/external-hard-drives/desktop-hard-drives/ba ckup-plus-desk/ntfs-driver-for-mac-os-master-dl/
    and installed it on the laptop. Then I selected the GoFlex volume, Command I and changed the access to read and write. Problem solved.

  • Management API - Create VM - InvalidXmlRequest - The request body XML was invalid or not correctly specified

    Hi,
    I am getting error while creating virtual machine from Azure REST management API. Could someone please point me what wrong I am POSTing in below XML
    ERROR ---
    <Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Code>InvalidXmlRequest</Code><Message>The request body's XML was invalid or not correctly specified.</Message></Error>
    " <Deployment xmlns=\"http://schemas.microsoft.com/windowsazure\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">" +
    " <Name>SomeName</Name>" +
    " <DeploymentSlot>Production</DeploymentSlot>" +
    " <Label>SomeLabel</Label>" +
    " <RoleList>" +
    " <Role>" +
    " <RoleName>SomeRoleName</RoleName>" +
    " <RoleType>PersistentVMRole</RoleType>" +
    " <ConfigurationSets>" +
    " <ConfigurationSet i:type=\"WindowsProvisioningConfigurationSet\">" +
    " <ConfigurationSetType>WindowsProvisioningConfiguration</ConfigurationSetType>" +
    " <ComputerName>SomeCompName</ComputerName>" +
    " <AdminPassword>Admin098</AdminPassword>" +
    " <EnableAutomaticUpdates>true</EnableAutomaticUpdates>" +
    " <ResetPasswordOnFirstLogon>false</ResetPasswordOnFirstLogon>" +
    " </ConfigurationSet>" +
    " <ConfigurationSet i:type=\"NetworkConfigurationSet\">" +
    " <ConfigurationSetType>NetworkConfiguration</ConfigurationSetType>" +
    " <InputEndpoints>" +
    " <InputEndpoint>" +
    " <LocalPort>3389</LocalPort>" +
    " <Name>RemoteDesktop</Name>" +
    " <Protocol>tcp</Protocol>" +
    " </InputEndpoint>" +
    " </InputEndpoints>" +
    " </ConfigurationSet>" +
    " </ConfigurationSets>" +
    " <OSVirtualHardDisk>" +
    " <DiskName>SomeDiskName-0-20121007173943</DiskName>" +
    " <MediaLink>http://portalvhdsrx7q659n2n5j2.blob.core.windows.net/public/myvhd0008980.vhd</MediaLink>" +
    " <SourceImageName>MSFT__Win2K8R2SP1-Datacenter-201208.01-en.us-30GB.vhd</SourceImageName>" +
    " </OSVirtualHardDisk>" +
    " <RoleSize>Small</RoleSize>" +
    " </Role>" +
    " </RoleList>" +
    " </Deployment>"I have tried adding admin user name as well to the xml but still get same error.Please suggest

    the format of the request body is:
    <Deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <Name>name-of-deployment</Name>
    <DeploymentSlot>deployment-environment</DeploymentSlot>
    <Label>identifier-of-deployment</Label>
    <RoleList>
    <Role>
    <RoleName>name-of-the-virtual-machine</RoleName>
    <RoleType>PersistentVMRole</RoleType>
    <VMImageName>name-of-vm-image</VMImageName>
    <ConfigurationSets>
    <ConfigurationSet i:type="WindowsProvisioningConfigurationSet">
    <ConfigurationSetType>WindowsProvisioningConfiguration</ConfigurationSetType>
    <ComputerName>name-of-computer</ComputerName>
    <AdminPassword>administrator-password</AdminPassword>
    <EnableAutomaticUpdates>enable-updates</EnableAutomaticUpdates>
    <TimeZone>time-zone</TimeZone>
    <DomainJoin>
    <Credentials>
    <Domain>domain-to-join</Domain>
    <Username>user-name-in-the-domain</Username>
    <Password>password-for-the-user-name</Password>
    </Credentials>
    <JoinDomain>domain-to-join</JoinDomain>
    <MachineObjectOU>distinguished-name-of-the-ou</MachineObjectOU>
    </DomainJoin>
    <StoredCertificateSettings>
    <CertificateSetting>
    <StoreLocation>LocalMachine</StoreLocation>
    <StoreName>name-of-store-on-the-machine</StoreName>
    <Thumbprint>certificate-thumbprint</Thumbprint>
    </CertificateSetting>
    </StoredCertificateSettings>
    <WinRM>
    <Listeners>
    <Listener>
    <Protocol>listener-protocol</Protocol>
    </Listener>
    <Listener>
    <CertificateThumbprint>certificate-thumbprint</CertificateThumbprint>
    <Protocol>listener-protocol</Protocol>
    </Listener>
    </Listeners>
    </WinRM>
    <AdminUsername>name-of-administrator-account</AdminUsername>
    <CustomData>base-64-encoded-data</CustomData>
    </ConfigurationSet>
    <ConfigurationSet i:type="LinuxProvisioningConfigurationSet">
    <ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType>
    <HostName>host-name-for-the-virtual-machine</HostName>
    <UserName>new-user-name</UserName>
    <UserPassword>password-for-the-new-user</UserPassword>
    <DisableSshPasswordAuthentication>password-authentication</DisableSshPasswordAuthentication>
    <SSH>
    <PublicKeys>
    <PublicKey>
    <FingerPrint>certificate-fingerprint</FingerPrint>
    <Path>SSH-public-key-storage-location</Path>
    </PublicKey>
    </PublicKeys>
    <KeyPairs>
    <KeyPair>
    <FingerPrint>certificate-fingerprint</FinguerPrint>
    <Path>SSH-public-key-storage-location</Path>
    </KeyPair>
    </KeyPairs>
    </SSH>
    <CustomData>base-64-encoded-data</CustomData>
    </ConfigurationSet>
    <ConfigurationSet>
    <ConfigurationSetType>NetworkConfiguration</ConfigurationSetType>
    <InputEndpoints>
    <InputEndpoint>
    <LoadBalancedEndpointSetName>name-of-load-balanced-set</LoadBalancedEndpointSetName>
    <LocalPort>local-port-number</LocalPort>
    <Name>name-of-endpoint</Name>
    <Port>external-port-number</Port>
    <LoadBalancerProbe>
    <Path>path-of-probe</Path>
    <Port>port-assigned-to-probe</Port>
    <Protocol>probe-protocol</Protocol>
    <IntervalInSeconds>interval-of-probe</IntervalInSeconds>
    <TimeoutInSeconds>timeout-for-probe</TimeoutInSeconds>
    </LoadBalancerProbe>
    <Protocol>endpoint-protocol</Protocol>
    <EnableDirectServerReturn>enable-direct-server-return</EnableDirectServerReturn>
    <EndpointACL>
    <Rules>
    <Rule>
    <Order>priority-of-the-rule</Order>
    <Action>permit-rule</Action>
    <RemoteSubnet>subnet-of-the-rule</RemoteSubnet>
    <Description>description-of-the-rule</Description>
    </Rule>
    </Rules>
    </EndpointACL>
    </InputEndpoint>
    </InputEndpoints>
    <SubnetNames>
    <SubnetName>name-of-subnet</SubnetName>
    </SubnetNames>
    <StaticVirtualNetworkIPAddress>ip-address</StaticVirtualNetworkIPAddress>
    </ConfigurationSet>
    </ConfigurationSets>
    <ResourceExtensionReferences>
    <ResourceExtensionReference>
    <ReferenceName>name-of-reference</ReferenceName>
    <Publisher>name-of-publisher</Publisher>
    <Name>name-of-extension</Name>
    <Version>version-of-extension</Version>
    <ResourceExtensionParameterValues>
    <ResourceExtensionParameterValue>
    <Key>name-of-parameter-key</Key>
    <Value>parameter-value</Value>
    <Type>type-of-parameter</Type>
    </ResourceExtensionParameterValue>
    </ResourceExtensionParameterValues>
    <State>state-of-resource</State>
    </ResourceExtensionReference>
    </ResourceExtensionReferences>
    <AvailabilitySetName>name-of-availability-set</AvailabilitySetName>
    <DataVirtualHardDisks>
    <DataVirtualHardDisk>
    <HostCaching>caching-mode</HostCaching>
    <DiskLabel>label-of-data-disk</DiskLabel>
    <DiskName>name-of-disk</DiskName>
    <Lun>logical-unit-number</Lun>
    <LogicalDiskSizeInGB>size-in-gb-of-data-disk</LogicalDiskSizeInGB>
    <MediaLink>path-to-vhd</MediaLink>
    </DataVirtualHardDisk>
    </DataVirtualHardDisks>
    <OSVirtualHardDisk>
    <HostCaching>caching-mode</HostCaching>
    <DiskLabel>label-of-operating-system-disk</DiskLabel>
    <DiskName>name-of-disk</DiskName>
    <MediaLink>path-to-vhd</MediaLink>
    <SourceImageName>name-of-source-image</SourceImageName>
    </OSVirtualHardDisk>
    <RoleSize>size-of-virtual-machine</RoleSize>
    <ProvisionGuestAgent>install-an-agent</ProvisionGuestAgent>
    </Role>
    </RoleList>
    <VirtualNetworkName>name-of-virtual-network</VirtualNetworkName>
    <Dns>
    <DnsServers>
    <DnsServer>
    <Name>dns-name</Name>
    <Address>dns-ip-address</Address>
    </DnsServer>
    </DnsServers>
    </Dns>
    </Deployment>
    for more details please see
    this link.
    hope this helps!

  • Internal ArgumentOutOfRangeException in EWS Managed API

    Dear Microsoft,
    We’ve been happily using the EWS Managed API for one of our products, but recently ran into an obscure problem with it.
    While forwarding e-mails always used to work flawlessly, we recently started getting the following, strange error at a client site: an ArgumentOutOfRangeException in some get_Item() method over 20 layers deep in the call stack.
     Microsoft.Exchange.WebServices.dll version number: 15.0.516.14
    The stacktrace:
    System.ArgumentOutOfRangeException: index is out of range.
    Parameter name: index
       at Microsoft.Exchange.WebServices.Data.ComplexPropertyCollection`1.get_Item(Int32 index)
       at Microsoft.Exchange.WebServices.Data.ComplexPropertyCollection`1.UpdateFromXml(EwsServiceXmlReader reader, XmlNamespace xmlNamespace, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.ComplexProperty.UpdateFromXml(EwsServiceXmlReader reader, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.InternalLoadFromXml(EwsServiceXmlReader reader, PropertyBag propertyBag)
       at Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.LoadPropertyValueFromXml(EwsServiceXmlReader reader, PropertyBag propertyBag)
       at Microsoft.Exchange.WebServices.Data.PropertyBag.LoadFromXml(EwsServiceXmlReader reader, Boolean clear, PropertySet requestedPropertySet, Boolean onlySummaryPropertiesRequested)
       at Microsoft.Exchange.WebServices.Data.ItemAttachment.TryReadElementFromXmlToPatch(EwsServiceXmlReader reader)
       at Microsoft.Exchange.WebServices.Data.ComplexProperty.InternalLoadFromXml(EwsServiceXmlReader reader, XmlNamespace xmlNamespace, String xmlElementName, Func`2 readAction)
       at Microsoft.Exchange.WebServices.Data.ComplexProperty.UpdateFromXml(EwsServiceXmlReader reader, XmlNamespace xmlNamespace, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.ComplexPropertyCollection`1.UpdateFromXml(EwsServiceXmlReader reader, XmlNamespace xmlNamespace, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.ComplexProperty.UpdateFromXml(EwsServiceXmlReader reader, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.InternalLoadFromXml(EwsServiceXmlReader reader, PropertyBag propertyBag)
       at Microsoft.Exchange.WebServices.Data.ComplexPropertyDefinitionBase.LoadPropertyValueFromXml(EwsServiceXmlReader reader, PropertyBag propertyBag)
       at Microsoft.Exchange.WebServices.Data.PropertyBag.LoadFromXml(EwsServiceXmlReader reader, Boolean clear, PropertySet requestedPropertySet, Boolean onlySummaryPropertiesRequested)
       at Microsoft.Exchange.WebServices.Data.EwsServiceXmlReader.ReadServiceObjectsCollectionFromXml[TServiceObject](XmlNamespace collectionXmlNamespace, String collectionXmlElementName, GetObjectInstanceDelegate`1 getObjectInstanceDelegate, Boolean
    clearPropertyBag, PropertySet requestedPropertySet, Boolean summaryPropertiesOnly)
       at Microsoft.Exchange.WebServices.Data.CreateItemResponseBase.ReadElementsFromXml(EwsServiceXmlReader reader)
       at Microsoft.Exchange.WebServices.Data.ServiceResponse.LoadFromXml(EwsServiceXmlReader reader, String xmlElementName)
       at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.ParseResponse(EwsServiceXmlReader reader)
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadResponse(EwsServiceXmlReader ewsXmlReader)
       at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponseXml(Stream responseStream)
       at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(IEwsHttpWebResponse response)
       at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
       at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalCreateItems(IEnumerable`1 items, FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode, ServiceErrorHandling errorHandling)
       at Microsoft.Exchange.WebServices.Data.Item.InternalCreate(FolderId parentFolderId, Nullable`1 messageDisposition, Nullable`1 sendInvitationsMode)
       at Microsoft.Exchange.WebServices.Data.EmailMessage.InternalSend(FolderId parentFolderId, MessageDisposition messageDisposition)
       at Microsoft.Exchange.WebServices.Data.EmailMessage.SendAndSaveCopy()
    The code that triggers it:
    ExtendedPropertyDefinition pr_flags =
    new
    ExtendedPropertyDefinition(3591,
    MapiPropertyType.Integer);
    itemAttachment.Item.SetExtendedProperty(pr_flags,
    "1");
    itemAttachment.Name = originalEwsMailObject.Subject;
    bodyBuilder.AppendLine("[product name etc. snipped]   forwarded because: \r\n\r\n"
    + reason);
    myMail.Body = bodyBuilder.ToString();
    myMail.ToRecipients.Add(adminAddress);
    myMail.SendAndSaveCopy();
    Does anyone know how to solve this, or is it perhaps a bug in the API and should I report it somewhere?
    Kind regards, 
    Tom Kersbergen
    Docspo B.V.

    The Managed API is now open source so if you go to
    https://github.com/OfficeDev/ews-managed-api clone the repository and compile a version to use in debugging then reproduce your problem you should be able to work out what's going wrong.
    Its looks like its having problems reading the response so you may want enable tracing
    https://msdn.microsoft.com/en-us/library/office/dn495632(v=exchg.150).aspx or watch the request/response with something like fiddler.
    Cheers
    Glen

  • Trying to retrieve list of rooms using EWS Managed API but it returned empty collection

    Hi,
    I'm trying to retrieve list of rooms using EWS Managed API. Before I have tried the following code I make sure our Administrator put all the rooms in a list following  link https://technet.microsoft.com/en-us/library/ee633471%28v=exchg.141%29.aspx.
    Here is the simple code I have used :
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.Exchange.WebServices.Data;
    using System.Net;
    using System.Security;
    namespace ExchangeConsole1
    class Program
    static void Main(string[] args)
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);
    service.Credentials = new NetworkCredential("username", "Password1", "domain");
    service.Url = new Uri("https://email.xxxx.com/ews/exchange.asmx");
    EmailMessage email = new EmailMessage(service);
    EmailAddressCollection listOfRoomList = service.GetRoomLists();
    // Display the individual rooms.
    foreach (EmailAddress address in listOfRoomList)
    Console.WriteLine("Email Address: {0}", address.Address);
    service.GetRoomLists() results "Enumeration yielded no results". Could anybody help me please ?
    Thanks
    Sandipan

    Enable tracing and see what the response from the server looks like. Also depending on your setup and how long ago your administrator created the list, it may take some
    time to replicate.
    Administrator has done it one week ago. Here is the trace response I am getting
    <Trace Tag="EwsResponse" Tid="9" Time="2015-04-10 15:36:37Z" Version="15.00.0847.030">
    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
    <h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="995" MinorBuildNumber="31" Version="V2_15" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <m:GetRoomListsResponse ResponseClass="Success" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
    <m:ResponseCode>NoError</m:ResponseCode>
    <m:RoomLists />
    </m:GetRoomListsResponse>
    </s:Body>
    </s:Envelope>
    </Trace>
    It's say no error.  Any help ?
    Thanks
    Sandipan

Maybe you are looking for

  • File - File Multimapping(1 File to be Split into N no of Files)

    Hi I have FILE 2 FILE Scenario. Requirement is to convert source xml file to n no of files. eg If we have 3 records in a source file , the target must have 3 files  added with timestamp.

  • Valuation of characteristics for unit of measure "" causes rounding diff

    Dear gurus, I am facing a problem on Goods Issue and Transfer Posting. My Material is maintained with Batch Specific Unit of Measure. Base Unit = Kg ,and Batch specific unit of Measure = BAL(Bales). My unit of Issue = BAL. For every bale at the the t

  • Passing parameters based on events

    Hi, I want to pass the parameters between portlets on a particular event e.g. onClick() or onChange(). The example which is given in PDK is not useful in such a scenario. How can I use htmlFormActionLink in this case ? Thanks In Advance, - Chetan

  • Scale effects in indesign Cs5

    Hi Everyone, I have some artwork with various shadows. Some of the artwork needs to be adapted large format. I need to scale the effects in indesign with the object, but the shadow stays the same size. I have checked my indesign prefs and made sure t

  • My Mac desktop has intermittent Wifi connectivity

    I've had a problem with wifi connectivity for over a year now, and have had the desktop repaired once already, with no improvement. Upgrade to Mavericks has made no difference. The computer always thinks that I have a connection to my network. In sys