Poweshell script for adding the computer object in to SCOM 2012 group.

Hi Team,
Is there any way to add the computer object ( csv file) to SCOM 2012 manually created  group.

Hi,
In addition, hope the links below be helpful for you:
Creating and Updating Groups
http://blogs.msdn.com/b/jakuboleksy/archive/2006/11/15/creating-and-updating-groups.aspx
Programmatically Creating Groups
http://blogs.technet.com/b/brianwren/archive/2008/11/18/programmatically-creating-groups.aspx
Modifying Explicit Group Membership in SCOM 2012 with PowerShell
http://blogs.msdn.com/b/rslaten/archive/2013/06/27/modifying-explicit-group-membership-in-scom-2012-with-powershell.aspx
Regards,
Yan Li
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Similar Messages

  • Script for putting servers under Maintiance mode in SCOM 2012

    Hi,
    Could someone pls help me out for putting windows servers under maintiance mode by using poweshell script. We have nearly 300 windows servers and needs to be put in maintiance mode as there was a scheduled activity. We are using scom2012 server.  I
    have gone through other sites and see some poweshell scripts. As am not good in scripting, pls help me out
    Regards, Rajeev Parambil

    Hi,
    Hope the below links can be useful for you:
    SCOM maintenance mode setting for list of servers
    http://blogs.technet.com/b/markmanty/archive/2012/05/14/scom-maintenance-mode-setting-for-list-of-servers.aspx
    Put Agents in Maintenance Mode using Remoting Powershell
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/2171ef8f-4a7f-4ec0-8d35-d5a903884dff/put-agents-in-maintenance-mode-using-remoting-powershell-?forum=operationsmanagergeneral
    Regards,
    Yan Li
    Regards, Yan Li

  • A script for adding the current date to file name?

    I am working in Indesign CS3. I frequently save file as PDFs into a designated folder. I was hoping for help in writing a script that would apply the current date to the end of the file name, when saved into this folder. Some days, I save the same file several times, into this folder. I was also hoping there was a way to add a date and version, for example "filename_2.25.11(1).pdf" Is this possible? Can someone help me?

    ok, I ended up with this test routine:
    on adding folder items to this_folder after receiving added_items
    tell application "Finder"
    repeat with this in added_items
    my checkifopened(this)
    display dialog (name of this) as text
    end repeat
    end tell
    end adding folder items to
    on checkifopened(this)
    set a to POSIX path of (this as alias)
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    exit repeat
    else
    say "still opened"
    end if
    end repeat
    end checkifopened
    this is a folder action that tests if the added file is still opened by an application... there is no delay between each test-loop since lsof takes some time to execute...
    And after adding a timeout (just in case) to this function the final script looks like this:
    on adding folder items to thefolder after receiving added_items
    tell application "Finder"
    set folderkind to kind of thefolder
    set myfiles to every item of thefolder whose name does not contain "#" and kind is not folderkind
    repeat with myfile in myfiles
    set myfile_datestring to my get_datestring(creation date of myfile)
    set myfilename to name of myfile
    if (count of every character of myfilename) > 4 and (character -4 of myfilename) as text is "." then
    set filestatus to my checkifopened(myfile, 60)
    if filestatus = false then
    display dialog "timeout on folder action"
    else
    set tmp to ((characters 1 through -5 of myfilename) & "#" & myfile_datestring & (characters -4 through -1 of myfilename)) as text
    set myfilename to my checknamewith_pdfsuffix(tmp, thefolder, false)
    set name of myfile to myfilename
    end if
    end if
    end repeat
    end tell
    end adding folder items to
    on get_datestring(mydate)
    return year of mydate & "-" & (characters -2 through -1 of (("0" & (month of mydate as integer)) as text)) & "-" & (characters -2 through -1 of (("0" & (day of mydate as integer)) as text)) as text
    end get_datestring
    on checknamewith_pdfsuffix(n, D, looped)
    --check if filename exists in D
    -- so if "A File.pdf" exists it names it "A File 1.pdf","A File 2.pdf",...
    #n = string of the filename
    #D = file reference to the directory to check
    #looped = boolean used for recursive loop...
    tell application "Finder"
    set thefiles to name of every item of (D as alias)
    end tell
    if thefiles contains n then
    if looped = false then
    set n to ((characters 1 through -5 of n) & "(1)" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    else
    set tmp to (last word of ((characters 1 through -5 of n) as text) as integer)
    set tmpcount to (count of characters of (tmp as text)) + 5
    set tmp to tmp + 1
    set n to ((characters 1 through (-1 * tmpcount) of n) & "(" & tmp & ")" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    end if
    else
    return n
    end if
    end checknamewith_pdfsuffix
    on checkifopened(this, mytimeout)
    ## this file reference
    ## timeout in seconds
    set a to POSIX path of (this as alias)
    set startdate to current date
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    return true
    else if ((current date) - startdate) > mytimeout then
    return false
    else
    ##say "still opened"
    end if
    end repeat
    end checkifopened
    to use this save this script in /Library/Scripts/Folder Action Scripts
    and add this as a folder action to your folder...
    The script processes all files inside that folder each time a new files is added...

  • Script for adding a login item for all accounts in the system

    Hi,
    Thanks for reading this query. I am new to the mac environment. I have developed a java application and created an installer of this application for MAC system.I want to run this application on starting the system. So I have written an apple script for adding this application in login items and this script will run immediately after completing installation process. And the entire process is fine. But the problem is, the application is added to login items of only the user who installed the application. But I want to get available the application in the login list of all accounts created in the system. How can I achieve this? Once more thanks in advance. I am attaching my script below:
    +*tell application "System Events"*+
    +* make login item at end with properties {path:"/Applications/MyApplication.app", hidden:true}*+
    +*end tell*+

    Hi,
    Try to use tables RSOSFIELDMAP, RSDSSEGFD and RSTRAN
    Hope it helps
    bhaskar

  • How to generate the DDL script of all the schema objects.

    Hi All,
    I just wanted to make centralized repository for Oracle database and to create a base version, I need to create the DDL scripts of all the database objects so that i can check in the same ddl scripts (sql) files in to my central repository.
    I need do this schedule job which will generate the ddl scripts once in a month(This should be automated process)
    Please help me out about this.
    Oracle version - 9i
    Thanks in advance.
    Thanks,
    Santosh
    Edited by: Santosh_Oracle on Feb 23, 2011 10:26 PM

    It is definitely possible to revise the script.
    Look at it, you already have 80 percent of it for free, and you didn't even need to Google.
    Just ask a FAQ in a forum loaded with FAQs!
    And Toad can save everything to one script per object.
    Sybrand Bakker
    Senior Oracle DBA

  • Script for adding datafile to tablespace

    Hi
    Does anyone have a template alter tablespace add datafile script handy?
    Basically, we need to, in the event of a tablespace alert, do two things:
    query that tablespace to see how much space is remaining.
    ascertain the size of the datafiles added to that tablespace already (to clarify what size we should make the additional datafile)
    finally, the command itself for adding the extra datafile.
    Thanks.
    10.0.2.0

    SELECT Total.tablespace_name "TSPACE_NAME",
    round(nvl(TOTAL_SPACE,0),2) Tot_space,
    round(nvl(USED_Space,0),2) Used_space,
    round(nvl(TOTAL_SPACE - USED_Space,0),2) Free_space,
    round(nvl(round(nvl((TOTAL_SPACE - USED_Space)*100,0),2)/(Total_space),0),2) "USED%"
    FROM
    (select tablespace_name, sum(bytes/1024/1024) TOTAL_SPACE
    from sys.dba_data_files
    group by tablespace_name
    ) Total,
    (select tablespace_name, sum(bytes/1024/1024) USED_Space
    from sys.dba_segments
    group by tablespace_name
    ) USED
    WHERE Total.Tablespace_name(+) = USED.tablespace_name and
    round(nvl(round(nvl((TOTAL_SPACE - USED_Space)*100,0),2)/(Total_space),0),2)< 20;
    the above query will display tablespaces which are having freespace below 20%
    select file_name,autoextensible,sum(bytes)/1024/1024,sum(maxbytes)/1024/1024
    from dba_data_files
    where tablespace_name='TBS_NAME'
    group by file_name,autoextensible;
    the above query will give details of datafiles like autoextensible or not etc.
    SELECT SUBSTR (df.NAME, 1, 40) file_name,dfs.tablespace_name, df.bytes / 1024 / 1024 allocated_mb,
    ((df.bytes / 1024 / 1024) - NVL (SUM (dfs.bytes) / 1024 / 1024, 0))
    used_mb,
    NVL (SUM (dfs.bytes) / 1024 / 1024, 0) free_space_mb
    FROM v$datafile df, dba_free_space dfs
    WHERE df.file# = dfs.file_id(+)
    GROUP BY dfs.file_id, df.NAME, df.file#, df.bytes,dfs.tablespace_name
    ORDER BY file_name;
    the above query will show how much freespace is left in each datafile.

  • Scripts for adding/deleting/modifying Open Directory accounts?

    I think I have searched high and low for an answer to this question, but if I missed it please point me in the right direction. Where can I find information on scripts for adding/deleting/modifying open directory accounts? At the very least, a command line utility with some syntax guidelines! Any help would be greatly appreciated.

    Hi
    I personally don't know if any scripts although you can use the command line to do pretty much anything you want with the Open Directory. Consult the manual: man dscl. If you launch terminal and issue dscl you should see something like this:
    my-Laptop:~ me$ dscl
    dscl (v20.4)
    usage: dscl [options] [<datasource> [<command>]]
    datasource:
    localhost (default) or
    <hostname> (requires DS proxy support, >= DS-158) or
    <nodename> (Directory Service style node name) or
    <domainname> (NetInfo style domain name)
    options:
    -u <user> authenticate as user (required when using DS Proxy)
    -P <password> authentication password
    -p prompt for password
    -raw don't strip off prefix from DS constants
    -url print record attribute values in URL-style encoding
    -q quiet - no interactive prompt
    commands:
    -read <path> [<key>...]
    -create <record path> [<key> [<val>...]]
    -delete <path> [<key> [<val>...]]
    -list <path> [<key>]
    -append <record path> <key> <val>...
    -merge <record path> <key> <val>...
    -change <record path> <key> <old value> <new value>
    -changei <record path> <key> <value index> <new value>
    -search <path> <key> <val>
    -auth [<user> [<password>]]
    -authonly [<user> [<password>]]
    -passwd <user path> [<new password> | <old password> <new password>]
    Entering interactive mode...
    The above is for 10.4 and should server equally as well for 10.5.
    Hope this helps, Tony

  • Scripts for changing the address of the user when they have been in the box for 6 months

    Scripts for changing the address of the user when they have been in the box for 6 months
    If users are in a folder for deactivated users and disabled users in Active Directory, and been there for 6 moths do: change email address in exchange to existing email address.old 
    Anyone have suggestions on how I can go about it?

    What is this "box"?  What is this "folder" you're asking about?  You'll likely get a better answer if you use standard terminology.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Script for Checking the Server Status

    Hi All,
         I just need the script for monitoring the server status through the WLST.My scenario:I have 2 server in Running State.If any one of the server get failed or in not RUNNING state then i use the script for starting that server automatically.I tried some of the script but it is not working properly .If any one have the sample script please share with me.
    Regards,
    Ove.

    Hi Syed,
    Replication state is very easy to see in 4.x and earlier. The last changenumber in the supplier changelog is visible (on the root DSE IIRC), and each consumer suffix has an operational attribute "copiedfrom" that tells you the name of the supplier, the database generation id, and the last change replayed from the supplier.
    So a script that compares the results of
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" lastchangenumber
    and
    ldapsearch -h <consumer> -s base -b <base_suffix> "objectclass=*" copiedFrom
    will show you if a replica has fallen out of sync. It won't tell you more than how many changes behind the replica is, though, because pre-5.x changenumbers are sequential integers, not timestamps.
    However, the change that corresponds to the changenumber is clearly visible under the "cn=changelog" suffix. So if you look at the change itself you can see the timestamp on it.
    For more info on the status of replication, you should be able to query the agreements on the supplier. Those live under the "Netscape Machine Data Suffix", which you can also find on the supplier's root DSE:
    ldapsearch -h <supplier> -s base -b "" "objectclass=*" netscapemdsuffix
    And of course the error logs will usually tell you if replication is failing outright.
    I may be off on some of the attribute names, but if you do some investigating along these lines, you should be able to figure it out.

  • Script for exporting the Delegated List from Exchange 2007

    We are Planing to Migrate the Exchange 2007 Mailbox to O365 by Hybrid deployment.
    So i would like to generate the List of delegated access rights on Mailboxes, could you help the script for genetating the delegated list.

    Hello,
    Look into get-Help Get-MailboxPermission
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Fnd script for upload the ldt file

    Hi Expert,
       How to write script for upload the ldt file containing program ,value set ,lookup code and DFF ,for XXCUST schema?
    Thanks

    7f4a32e8-5494-4664-a2f3-632ede8de56c wrote:
    Hi Expert,
       How to write script for upload the ldt file containing program ,value set ,lookup code and DFF ,for XXCUST schema?
    Thanks
    FNDLOAD commands can be found in (Tips and Examples Using FNDLOAD (Doc ID 735338.1)).
    Thanks,
    Hussein

  • Tcode for displaying the locked objects

    Hi Experts,
    Can anybody please let me know what is the tcode for displaying the "locked objects" for a user? Thanks a ton for your help.

    Hi Sam,
    you can see the locked objects in E071 table.
    Reward if it helps,
    Satish

  • HT1277 When I send or receive an email on Mail for Mac, the computer stores the email address of either the sender or recipient.

    When I send or receive an email on Mail for Mac, the computer stores the email address of either the sender or recipient.
    The next time I send an email it fills in the name after typing a few letters.
    Is there any way to get a complete list of the email addresses that are stored in this fashion.
    LJCollingwood

    Go to Mail > top menu bar > Window and select 'Previous recipients'.

  • Need  Shell Script  for picking the files

    Hi,
        I want to write a shell script for piking the files in a sequence order (according to filename with time stamp)  from the sorce FTP server ..
                     Requirement is  in the source directory I'm getting files (Jain_1.xml  , Jjain_2.xml, Jain_3.xml .. ect..)  at  present my file adapter is picking all the files at a time  but  i want to pick  one by one... that to first i want to Jain_1.xml  after finish the processing of the file then only my file adapter should  pick the next file ( Jain_2.xml )  .
                  so..  all the forum mates suggest me to write a shell script..  but where  i have to write the s hell script. and where i have to deploy this script.... my Xi is running on UNIX ... so please sugest me  the procedure ...
    Regards
    Jain

    Hi,
    Why dont you use the option EOIO in which files will be picked up in order and will be proccessed in sequence....one after another....
    Regards,
    Sreeni.

  • Custome Defined Pacakge for transporting the BW Objects

    hai
    Im going to transport the BW-Objects from the development server to QA server.
    I need to 'Custome Defined Package(ZBW)' for this one . So how can i create the Custome Package for transportating the BW objects.
    pls tell me , i will assign the points
    kumar

    Transaction SE80
    Select development class and create.
    Jaya

Maybe you are looking for

  • Wrong GET_CURRENT_CELL  result

    Hi there. I've got a problem with CL_GUI_ALV_GRID object. In PBO when creating grid: *&      Module  STATUS_1024  OUTPUT *       text MODULE STATUS_1024 OUTPUT. *  SET PF-STATUS 'xxxxxxxx'. *  SET TITLEBAR 'xxx'.   DATA: line   LIKE LINE OF G_ukoly .

  • Item Renderer Display Optimization

    I have pretty basic row item renderer displayed within a data group, it is composed of a few labels and an icon. It has a few nested layouts to display everything properly, but I would not consider it a complicated layout by any means. Whenever I dis

  • ODI: Load metadata into EPMA ("non-classic") Planning app

    Hi all, I know about loading metadata to classic planning/essbase application, but tell me please if its possible to load metadata to non-classic planning app (I mean created in Architect (in application library) and see it in dimension library? mayb

  • File 2 Proxy error

    Hi All, i am getting following error while doing the File to Proxy Scenario. No implementing class registered for the interface (ABAP interface, request message MI_Emp_Sender, request message, namespace http://tcs.com/Demo) How to resolve this error.

  • Complete mess of audio setup

    For almost a year now, I've had audio play through SPDIF to a 5.1 surround receiver.  Both surround and stereo worked like a charm through 1 cable.  I haven't bothered watching a movie on this system in nearly 2 months, but when I tried to today, I n