Getting all computers of SCSM using Service Manager SDK C#

I have been working in getting all computer available in SCSM using Service Manager SDK in C# but could not able to extract all those available computers.
I have tried System.ConfigItemRelatesToConfigItem as well but could able to get as it returns empty list of computer.
Can anyone help me out to get all computers of SCSM?

Here is,
[TestMethod]
public void GetComputers()
using (var sys = new EnterpriseManagementGroup("YOURSERVER"))
ManagementPack mpIncident = sys.ManagementPacks.GetManagementPack("System.WorkItem.Incident.Library", "31bf3856ad364e35", new Version(1, 0, 0, 0));
ManagementPackClass requestClass = mpIncident.GetClass("System.WorkItem.Incident");
IObjectReader<EnterpriseManagementObject> reader;
List<Guid> objectIds;
ManagementPackClass classWindowsComputer =
sys.EntityTypes.GetClass(new Guid("EA99500D-8D52-FC52-B5A5-10DCD1E9D2BD"));
IObjectReader<EnterpriseManagementObject> readerEmoWindowsComputers =
sys.EntityObjects.GetObjectReader<EnterpriseManagementObject>(classWindowsComputer, ObjectQueryOptions.Default);
Console.WriteLine(readerEmoWindowsComputers.Count);
foreach (EnterpriseManagementObject emoWindowsComputer in readerEmoWindowsComputers)
Console.WriteLine(string.Format("{0} => {1} => {2}", emoWindowsComputer.Id, emoWindowsComputer.DisplayName, emoWindowsComputer.Name));

Similar Messages

  • How to get Request Offering from given Service Offering using Service Manager SDK?

    Recently, I am working on application where I have to fetch all Request Offering from given Service Offering. 
    I can retrieve all Request Offering using following method of SM SDK : 
    var requestOfferings = group.Extensions.Retrieve<RequestOffering>();// group is Management Group
    But I am unable to get request Offering from given Service Offering as I am new to this platform. I have searched in web but can not find solution to this problem.
    It would be great if someone guide for this problem or give me any suggestion related to this problem.
    Thanks in advance.

    RequestOfferings are handled a little differently in the SDK, but fortunately, they're still backed by standard EnterpriseManagementObjects..it just takes a little work to get them.
    There are a few ways you can go about getting a request offering's related service offerings. I'm going to show you the relationship route, but you could also use a type projection to achieve the same goal.
    In your original post, you're simply retrieving _all_ request offerings..that's fine. If you wanted to retrieve a single request offering (as I do in my example) you need to find the request offering's identifier. This identifier is a pipe delimited string
    of various values. The quickest way to find it, in my opinion, is to query the MT_System$RequestOffering table in the database, but you can also find it by looping through all the RequestOfferings returned by group.Extensions.Retrieve<RequestOffering>();
    Anyway, for the following example to work, you only need your request offering's Identifier and your management server name. (Again, you could simply loop through all of your request offerings and retrieve the service offerings for all of them)
    The comments inline with this example should guide you through the steps.
    //Connect to the management group and prepare the class and relationship types that we'll need.
    String strMySCSMServer = "your server";
    EnterpriseManagementGroup emg = new EnterpriseManagementGroup(strMySCSMServer);
    ManagementPackClass mpcRO = emg.EntityTypes.GetClass(new Guid("8FC1CD4A-B39E-2879-2BA8-B7036F9D8EE7")); //System.RequestOffering
    ManagementPackRelationship relSORelatesToRO = emg.EntityTypes.GetRelationshipClass(new Guid("BE417A55-6622-0FC3-FCEA-90CD23E0FC23")); //System.ServiceOfferingRelatesToRequestOffering
    //An example of an extension identifier looks like this:
    //1|My.RO.MP|1.0.0.0|Offeringc921c4feujhoi8cdsjloiz352d7gf3k0|3|RequestOffering
    String strRequestOfferingIdentifier = "your request offering identifier";
    //Retrieve the request offering using an Extension Identifier.
    ExtensionIdentifier ei = null;
    ExtensionIdentifier.TryParse(strRequestOfferingIdentifier, out ei);
    RequestOffering ro = emg.Extensions.Retrieve<RequestOffering>(ei);
    //Using the request offering's Identifier, retrieve the enterprise management object that it represents
    EnterpriseManagementObjectCriteria emocRO = new EnterpriseManagementObjectCriteria("ID = '" + ro.Identifier + "'", mpcRO);
    IObjectReader<EnterpriseManagementObject> orROs = emg.EntityObjects.GetObjectReader<EnterpriseManagementObject>(emocRO, ObjectQueryOptions.Default);
    //Since we queried for only a single Request Offering, the object reader should contain 0 or 1 elements.
    EnterpriseManagementObject emoRO = null;
    if (orROs.Count > 0)
    emoRO = orROs.ElementAt(0);
    else
    Console.WriteLine("No Request Offering found");
    //Now, using the relationship type "System.ServiceOfferingRelatesToRequestOffering", get all Service Offering's related to our request offering
    IList<EnterpriseManagementRelationshipObject<EnterpriseManagementObject>> lstEMROs = emg.EntityObjects.GetRelationshipObjectsWhereTarget<EnterpriseManagementObject>(emoRO.Id, relSORelatesToRO, DerivedClassTraversalDepth.None, TraversalDepth.OneLevel, ObjectQueryOptions.Default);
    //The GetRelationshipObjectsWhereTarget method returns a list of EnterpriseManagementObjectRelationships..These objects represent that relationship between two objects.
    //Thus, these relationship objects have two properties of interest; TargetObject and SourceObject. In this case, service offerings are the source of this relationship type and
    //so, you can access the service offering object itself by using the relationship object's SourceObject property (which is nothing more than an EnterpriseManagementObject)
    foreach (EnterpriseManagementRelationshipObject<EnterpriseManagementObject> emro in lstEMROs)
    //emro.SourceObject is your Service Offering object. You can use it for whatever you need from here on out. In this example, i'm just writing out the DisplayName
    EnterpriseManagementObject emoServiceOffering = emro.SourceObject;
    Console.WriteLine(emoServiceOffering[null, "DisplayName"].Value);
    Give it a try, let me know if you have any questions :)

  • I have changed my Apple ID on my iPad, but my iPhone keeps popping up with the old ID.....how do I get all my devices to use the same ID?

    How can I get all my devices to use the same Apple ID?

    Different services on your iOS device (iMessage, Facetime, iCloud, iTunes and App Store) can be signed into with an Apple ID of your choice. Make sure you verify the settings for each device and that you are signed in to each service with the correct Apple ID.
    I'll do an example for iMessage:
    1) Go to settings on your iOS device
    2) Select "Messages"
    3) Select "Send & Receive"
    4) At the very top you will see "Apple ID", by selecting your Apple ID, you will now have the option to sign out of messages with the current Apple ID, and sign in with the new one.
    The steps for changing your Apple ID for other services will be very similar.
    tHIS SHOULD BE VERY HELPFUL TOO YOU.

  • How to get all events from calendar using calcalendar store framework.

    Hello,
    I have two problems with calcalendar store framework programming.
    1. I need all the event which are present in iCal calendar.Event may be present in year 2025 or 2050. and if the event is recurring then i need only one event.
    2. if the event is recurring then i need only one event within the calendar event predicates (start date and end date). I am not suppose to give the occurrence date for event.
    How can I implement this with CalCalendar store framework.
    Thanks And Regards,
    xmax.

    Hi,
    Per my knowledge, there is not a method to get all the recurring events using CAML query in one request.
    Here is a thread with the similar question for your reference:
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/eed6be6d-c9ff-4d01-80de-8a4b67d3d7a5/use-caml-to-get-all-recurring-events-from-a-calendar
    We can get all the calendar list events at first, then filter all the recurring event from the result set.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Query to get all ports assigned and used by EBS instance.

    Hi,
    Can some one pleaase help to get
    Query to get all ports assigned and used by EBS instance.
    Help is appreaciated.
    Regards,
    Milan

    MILAN RATHOD wrote:
    Hi,
    Can some one pleaase help to get
    Query to get all ports assigned and used by EBS instance.
    Help is appreaciated.
    Regards,
    MilanIn addition to the thread referenced above by Helios, please check the context files and (Oracle E-Business Suite R12 Configuration in a DMZ [ID 380490.1] -- F. List of Ports to Open in a DMZ Configuration).
    Thanks,
    Hussein

  • PowerShell: How do I get Powershell ISE to work within Service Manager Shell

    I want to use PowerShell ISE from within Service Manager Shell.
    When, from within the Service Manager Shell I type "ise" the PowerShell ISE launches but is not aware of the SCSM Cmdlets.
    When I run:
    PS C:\Program Files\Microsoft System Center 2012\Service Manager> Get-SCSMManagementPack
    I get this error:
    The term 'Get-SCSMManagementPack' is not recognized as the name of a cmdlet, function, scr
    ipt file, or operable program. Check the spelling of the name, or if a path was included,
    verify that the path is correct and try again.
    At line:1 char:23
    + Get-SCSMManagementPack <<<<
        + CategoryInfo          : ObjectNotFound: (Get-SCSMManagementPack:String) [], Command
       NotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException

    Hi,
    Try this before calling any SCSM cmdlets:
    CD 'C:\Program Files\Microsoft System Center 2012\Service Manager\Powershell'
    Import-Module .\System.Center.Service.Manager.psd1
    For R2 adjust a path.
    Cheers,
    Marat
    Site: www.scutils.com  Twitter:
      LinkedIn:
      Facebook:

  • Error when calling Get-AzureBiztalkService from Windows Azure BizTalk Services Management Sample

    I've downloaded and built the Windows Azure BizTalk Services Management Sample from
    https://code.msdn.microsoft.com/windowsazure/Windows-Azure-BizTalk-91e1bdf3
    I've imported the module into PowerShell and have run the following script successfully
    $sub = '<subscription id>'
    $cert = get-childitem -path cert:\CurrentUser\My\<certifcate thumbprint>
    Set-AzureSubscription -SubscriptionName "Test" -SubscriptionId $sub -Certificate $cert
    select-azuresubscription -SubscriptionName "Test"
    replacing <subscription id> with my Azure subscription id from the portal and <certifcate thumbprint> with a thumbprint from a self signed certificate in my personal store.
    am now trying the following command
    get-azurebiztalkservice -resourcename "oraman8"
    where "oraman8" is my BizTalk Service and getting the following
    Get-AzureBizTalkServiceProperties : Error in subscription or certificate.
    At line:1 char:1
    + Get-AzureBizTalkServiceProperties -ResourceName "oraman8"
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidData: (:) [Get-AzureBizTalkServiceProperties], Exception
        + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.BizTalkService.GetAzureBizTalkServiceProperties
    thanks in advance for any help
    Omar

    Are you not using port 1433 for SQL? Is the telnet successful on that port?

  • HELP The sound gets all weird when i use effects

    ok, this may be super simple but i just can't figure it out!
    i import movies and they sound great, but *whenever i have to adjust contrast or add subtitles* they sound gets all weird and you just can't understand a thing!!
    the problem is that i'm working on my final presentation and i only have one more week to fnd out what's wrong... *I'M GETTING CRAZYYY* lolol
    HELP!

    Hi
    There are many who has problems with audio and mainly transitions in iMovie HD 6.
    Origin: Unknown to me
    Work around:
    • Select video clips
    • Advance menu -> Extract audio
    • Now apply transitions or other effects
    A Working solution
    IF NOT:
    Not knowing the origin to Your problem - General approach when in trouble is as follows:
    • Free space on internal (start-up) hard disk if it is less than 10Gb should rather have 25Gb
    • Hard disk is untidy: Repair Permissions, Repair Hard disk (Apple Disc Util tool)
    • Delete iMovie pref file - or rather start a new user/account - log into this and re-try
    • Third party plug-ins that doesn't work OK (not relevant for iMovie’08)
    • Program miss-match: iMovie 5.0.2, up to Mac OS X.4.11 AND QuickTime 7.4.1 - is OK
    • Program miss-match: iMovie 6.0.3 or 6.0.4, Mac OS X.4.11 AND QuickTime 7.4.1 - is OK (might work under Leopard)
    • Program miss-match: iMovie’08 v. 7.0.1, Mac OS X.4.11 AND QuickTime 7.4.1 - is OK (might work under Leopard)
    iMovie pref file resides: Mac Hard Disk (start-up HD)/Users/"Your account"/Library/Preferences
    and is named: com.apple.iMovie.plist
    While iMovie is NOT RUNNING - move this file out to desk-top.
    Now restart iMovie.
    Yours Bengt W

  • OdbcDataAdapter.Fill() not getting all rows from RDB using 64bit driver

    I am using VS2012 Pro on Windows 7 (64-bit). I am migrating an older 32-bit VS2008 app to the new environment. I'm building for the .NET Framework 4.5.
    The app queries an RDB database and uses the Oracle RDB drivers version 3.3.2.0. When I build as a 32-bit app and use the 32-bit Oracle RDB Driver, the query succeeds and returns all 341 data rows. When I built it as 64-bit and use the 64-bit driver, I only
    get the first 101 rows.
    Oracle says the problem is in the OdbcDataAdapter.Fill() method. I was able to confirm this. I created an OdbcDataReader and used the debugger to see what was being read, I can see all 341 rows, but when I use the DataAdapter.Fill (or DataSet.Load) method,
    the results are truncated to 101 rows. Changing the SQL to query different tables does not change the problem. Below is a code sample:
            private DataSet runQuery()
                string connString32 = @"PROVIDER=MSDASQL;DRIVER={Oracle RDB Driver};SVR=myserver;DATABASE=ATTACH 'filename mydatabase';CLS=myclassname;uid=myusername;pwd=mypassword;xpt=2";
                string connString64 = @"PROVIDER=MSDASQL;DRIVER={Oracle RDB Driver 64 Bit};SVR=myserver;DATABASE=ATTACH 'filename mydatabase';CLS=myclassname;uid=myusername;pwd=mypassword;xpt=2";
                string sql = "SELECT person_id FROM person_tab";      
                DataSet ds = new DataSet();
                using (OdbcConnection conn = new OdbcConnection(connString64))  
                    OdbcCommand cmd = new OdbcCommand(sql, conn);
                    OdbcDataAdapter da = new OdbcDataAdapter();
                    da.SelectCommand = cmd;
                    conn.Open();
                    da.Fill(ds, "myDataSet");
                return ds;
    Has anyone else encountered this problem? If so, how did you get around it?

    Hello,
    Since I do not have the RDB database, I made a test with both 32bit and 64bit ODBC Driver 11 for SQL Server and query for 1000 records, however, both of them can work fine.
    As far as I know, the ODBC is just a component as a bridge to connect the driver and the application and since you are use the Oracle RDB driver, I suggest you posting it to the Oracle forum:
    https://community.oracle.com/community/developer/english
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Get All group from LCES using Livecycle java API

    Hello ,
    Can anyone told me how i can retrieve all the groups that exist in my livecyle using JAVA API.
    Some method who return all groups ??
    Thanks!

    First Thank you for your answer
    I tried this part
    //Set connection properties required to invoke LiveCycle ES
                Properties connectionProps = new Properties();
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "jnp://test:1099");
                                                                      connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
                connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
                ServiceClientFactory scf = ServiceClientFactory.createInstance(connectionProps);
                DirectoryManager directoryManager = new DirectoryManagerServiceClient(scf);
                PrincipalSearchFilter psf = new PrincipalSearchFilter();
        psf.setPrincipalType(Principal.PRINCIPALTYPE_GROUP);  //Recommended - refines the search to a User or Group
        psf.setRetrieveOnlyActive(); // Recommended - returns only ative users/groups and not obsolete/deleted users/groups
        List<Principal> resultList = directoryManager.findPrincipals(psf);
        System.out.println("Done");
    and when I check the result of my list I find incomprehensible informations.
    So when I debug the code ,  my list  contains little information.
    NB : my LDAP contains hundreds of groups.
    Any suggestion
    Any code Source.

  • Getting all Functions and Procedures using DBA_ARGUMENTS

    Hi All
    I am wanting to find out all functions and procedures that are within each of my packages and am using the following SQL to do this.
    SELECT DISTINCT A.OBJECT_NAME, A.PACKAGE_NAME,
    DECODE(POSITION,0,'FUNCTION','PROCEDURE')
    FROM DBA_ARGUMENTS A
    WHERE OWNER = 'NB'
    I have discovered however that if a procedure has been overloaded with function will appear twice: as procedure and as a function
    I was wondering if there was any workaround for this as I would only like a function to be displayed once?
    Kind Regards
    Mark

    There is an 'OVERLOAD' column which can be used to show only specific overloads (e.g. first).
    Determining which overload should be displayed in any given case may require some more thought.

  • How to Upgrade Service Manager 2012 SP1 with Windows 2008 R2 to SCSM 2012 R2 with Windows 2012 R2

    Hi,
    We are using Service Manager 2012 SP1 UR2 with Windows 2008 R2.
    I am planning to upgrade Service Manager to R2 with Windows 2012 R2. I found the steps to upgrade SCSM 2012 Sp1 to R2 but need assistance to upgrade with 2012 R2 OS.
    Please suggest how to achieve the above mentioned objective.
    Regards, Syed Fahad Ali

    Virtualization solves this problem handily, by allowing you to create a new server to run the new program on the same hardware. it also solves the related problem of moving off unsupported hardware without changing OS or application. VMware is my personal
    favorite, but Hyper-V, Xen, and VirtualBox all have similar capabilities.
    Compare the cost of work and confidence in success of a upgrade, where any of thousands or millions of uncontrolled settings could cause an issue, to the cost of work and confidence in success of installing a new OS instance and configuring a known state
    for the new environment.
    In short, upgrades should no longer be a thing. there are just too many ways they can go wrong, and it's far too easy to create a new OS with minimal expense and effort.

  • How to get the image in docking control  in a report using doc management

    HI All
    My question is that is that i am storing one image using documents in jha2n.
    Now I want to get that image in report using Document management.
    Pls guide how to proceed as I am new and dont know anything about document management.
    Thanks
    Pooja

    Hi,
    Please kindly refer to the online help link below:
    [http://help.sap.com/saphelp_erp60_sp/helpdata/en/7a/973035624811d1949000a0c92f024a/frameset.htm|http://help.sap.com/saphelp_erp60_sp/helpdata/en/7a/973035624811d1949000a0c92f024a/frameset.htm]
    And for handling the DMS document, you may check the BAPIs in SAP Note: 504692
    Function group: CVBAPI
    BAPI_DOCUMENT_GETDETAIL2
    BAPI_DOCUMENT_CREATE2
    BAPI_DOCUMENT_CHANGE2
    BAPI_DOCUMENT_DELETE
    For display image in the docking control, pleae kindly refer to the SAP DEMO: RSDEMO_DOCKING_CONTROL
    Cheers,

  • How can I retrieve/compute an X509 certificate's thumbprint in Python and then use it for accessing Service Management APIs from Python SDK?

    Hello,
    I am using Azure Python SDK to perform calls to ServiceManagement APIs.
    I have a .publishsettings file generated for my account which includes an encoded version of my X509 certificate and all of my subscription IDs.
    How can I retrieve/compute an X509 certificate's thumbprint in Python?
    Following is the code snippet that helps us do it in .Net.
    Is there a similar approach to do it in Python?
    var publishSettingsFile = @"C:\temp\CORP DPE Account-11-16-2011-credentials.publishsettings";
    XDocument xdoc = XDocument.Load(publishSettingsFile);
    var managementCertbase64string = xdoc.Descendants("PublishProfile").Single().Attribute("ManagementCertificate").Value;
    var importedCert = new X509Certificate2(Convert.FromBase64String(managementCertbase64string));
    thumbprint = importedCert.Thumbprint;
    Once I have the thumbprint, how can I use that thumbprint to access Service Management APIs from Python SDK?
    Thank you in Advance!
    Regards,
    Vaibhav Kale

    Hi,
    Please have check on the below article and check if it helps.
    http://azure.microsoft.com/en-in/documentation/articles/cloud-services-python-how-to-use-service-management/
    Regards,
    Mekh.

  • 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.

Maybe you are looking for

  • Batch handle with 'Auto Select' option

    Hello Everyone! We are trying to find out how the 'Auto Select' button works with batch handle. Our customer wants to handle batches by FIFO. We need to try if it is possible to 'Auto Select' batches by 'Admission Date'. Even when we found out that i

  • Connecting to home theatre system but is not recognized

    trying to connect to sony home theater system but says its not supported.  It states that ipod classic is supported.  Is there a way to update my older ipod?

  • Opacity drop down arrow in clip

    I am confused on function of the 'opacity drop down arrow' on the top of each clip. After looking at the PIP guide, I am now assuming that it is mostly when PIP is used? Usually I get a choice of 'Motion" with the 6 submenu options relating to PIP I

  • Reset Password on Admin Account

    Hi All, I have a server running Windows Server 2008 R2 and I have forgot the password to log into the admin account (its been a while since I have logged in!) I have been looking though the fourm and on the internet and everyone is saying the same th

  • C'mon--how do I get around NOT printing from Firefox!!

    I feel like an idiot. I order and receive my brand new Photosmart Premium C309g one week ago, thinking I got a great new printer...only to find out I can't print a thing from Firefox, which I exclusively use. You've got to be kidding. I've been able