Optimize Powershell script (reboot remote Server and Check Services)

Hi there,
For my next maintenance Weekend i try to write a script to reboot all Servers and check after the reboot all automatic Service if there are running or not.
Now the Script works fine for me so far, but it is not perfect. I would like to ask if anybody could help me to optimize it.
# First Part: Reboot Servers
$date = Get-Date -Format dd-MM-yyyy
# Get list of Servers
$Servers = Get-Content "D:\Scripts\Reboot\servers.txt"
# Reboot each server
ForEach ($Server in $Servers)
"Computer $Server initiated reboot at $(Get-Date)" | Add-Content -Path D:\Logs\Reboot\Rebootlogs_$date.txt
Restart-Computer $Server -Force -Wait
# Check each Server
forEach ($Server in $Servers)
if (Test-Connection $Server -quiet) { "Computer $Server verified to be responding to ping at $(Get-Date)" | Add-Content -Path D:\Logs\Reboot\Rebootlogs_$date.txt }
else { "Computer $Server unresponsive to ping at $(Get-Date)" | Add-Content -Path D:\Logs\Reboot\Rebootlogs_$date.txt }
# Seconde Part: Check Services
# Get list of Servers
$Servers = Get-Content "D:\Scripts\Reboot\servers.txt"
# Check Auto Services on each Server
ForEach ($Server in $Servers)
ForEach-Object {
Write-Output $Server | Out-File -FilePath "D:\Logs\Reboot\services_$date.txt" -Append
# get Auto that not Running:
Get-WmiObject Win32_Service |
Where-Object { $_.StartMode -eq 'Auto' -and $_.State -ne 'Running' } |
# process them; in this example we just show them:
Format-Table -AutoSize @(
'Name'
'DisplayName'
@{ Expression = 'State'; Width = 9 }
@{ Expression = 'StartMode'; Width = 9 }
'StartName'
) | Out-File -FilePath "D:\Logs\Reboot\services_$date.txt" -Append
As you can see i do it in two parts, the perfect way might be in one, where i check one server and write also just one log with all information.
At the Moment the log files Looks like that:
Reboot:
Computer server1 initiated reboot at 04/28/2015 15:14:51
Computer server2 initiated reboot at 04/28/2015 15:16:40
Computer server1 verified to be responding to ping at 04/28/2015 15:17:41
Computer server2 verified to be responding to ping at 04/28/2015 15:17:44
Service:
Server1
Name           DisplayName         State   StartMode StartName                
RemoteRegistry Remote Registry     Stopped Auto      NT AUTHORITY\LocalService
sppsvc         Software Protection Stopped Auto      NT AUTHORITY\NetworkSer...
Server2
Name           DisplayName         State   StartMode StartName                
RemoteRegistry Remote Registry     Stopped Auto      NT AUTHORITY\LocalService
sppsvc         Software Protection Stopped Auto      NT AUTHORITY\NetworkSer...
Now my Question is how to Change maybe my Loop or code to get one Log like that:
Computer server1 initiated reboot at 04/28/2015 15:14:51
Computer server1 verified to be responding to ping at 04/28/2015 15:17:41
Name           DisplayName         State   StartMode StartName                
RemoteRegistry Remote Registry     Stopped Auto      NT AUTHORITY\LocalService
sppsvc         Software Protection Stopped Auto      NT AUTHORITY\NetworkSer...
Computer server2 initiated reboot at 04/28/2015 15:16:40
Computer server2 verified to be responding to ping at 04/28/2015 15:17:44
Name           DisplayName         State   StartMode StartName                
RemoteRegistry Remote Registry     Stopped Auto      NT AUTHORITY\LocalService
sppsvc         Software Protection Stopped Auto      NT AUTHORITY\NetworkSer...
Thanks for helping.

You could probably have something nice using Function and CmdletBinding so you can get something like:
function reboot-myservers { blablabla }function check-myservices { blablabla }$Servers = Get-Content "D:\Scripts\Reboot\servers.txt" $servers | reboot-myservers | check-myservices
Bruce Jourdain de Coutance - Consultant MVP Exchange http://blog.brucejdc.fr

Similar Messages

  • Help with two scripts - Mounting remote DMG and Checking which network I'm connected to

    Hey guys, I need some help with two separate scripts:
    1. The first script I'm trying to create to mount a DMG stored remotely on another Mac using an AppleScript or shell script. Using the following:
    set cmd to "hdiutil mount 'afp://username:[email protected]/Lion/Users/username/Desktop/Test.sparseim age'"
    do shell script cmd
    results in the following error:
    error "hdiutil: mount failed - not recognized" number 1
    I'm not very experienced regarding AppleScript or using hdiutil, could somebody point out what's wrong with my script?
    2. The second script I'm working on to try and essentially prevent the 'Could Not Find Server' Finder dialog when a network mount is unavailable. I guess what I'd like it to do is detect which network I'm connected to, and if I'm connected to the correct network, then mount the shares, otherwise just fail silently without any errors. From the searching I've done, using try statements should do this, but they do not, and I'm still presented with an error dialog after the server cannot be found.
    Does anybody have any suggestions on this script? Also, I've seen some tips regarding detecting which wireless network the Mac is connected to, which could work, but what about when connected via Ethernet?
    Thanks!

    Edit: I need to clarify on my first script request:
    I need to mount the DMG on the remote Mac, not on the Mac I'm running the script from.

  • Executing powershell script from remote computer using RSAT

    Hi.
    I want to execute powershell script on AD server from remote computer (in the same domain). I installed and tested RSAT - it is working fine. But i cant execute PS from c# code.
    ps.Commands.AddCommand("Import-Module").AddArgument("ActiveDirectory");
    ps.Invoke();
    ps.Commands.AddCommand("Get-ADOrganizationalUnit -Filter 'Name -like \"*\"'");
    var res = ps.Invoke();
     And i get exception:
    An unhandled exception of type 'System.Management.Automation.CommandNotFoundException' occurred in System.Management.Automation.dll
    Additional information: The term 'Get-SBNamespace' is not recognized as the name of a cmdlet, function, script 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.

    Hi
    CapitanPlanet
    For the
    CommandNotFoundException, it means the command cannot be found.
    On the other hand, your issue is about the PowerShell, if you still have the issue, I suggest that you should post it in the
    PowerShell forum for efficient response.
    Here are some useful information, please check
      Powershell
    commands from C# not working (System.Management.Automation.CommandNotFoundException)
    Powershell, Service Bus For Windows Server Programmatically: Command found, module could not be loaded
    https://msdn.microsoft.com/en-us/library/dn282152.aspx
    Best regards,
    Kristin
    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.

  • Log on to remote server and start database -error while installing CI in HA

    Hello All,
    We are installing ECC 6.0 with High Availability using HP-UX. We have completed installation in ASCS and Database Instance. Now when were trying to install in Central Instance, we encountered an error at Start Instance which informed us to Log on to remote server and start database. However the database is already running in DB node.  Please find the log below.
    TRACE      2011-06-10 16:31:45.825 [syuxctask.cpp:1382]
               CSyTaskImpl::start(bool)
    A child process has been started. Pid = 25742
    INFO       2011-06-10 16:31:45.835
               CJSlibModule::writeInfo_impl()
    Output of /usr/sap/PE2/SYS/exe/run/startsap all DVEBMGS01 DBMCI001 is written to the logfile start_PE2_DVEBMGS01.log.
    WARNING    2011-06-10 16:31:46.345
               CJSlibModule::writeWarning_impl()
    Execution of the command "/usr/sap/PE2/SYS/exe/run/startsap all DVEBMGS01 DBMCI001" finished with return code 6. Output:
    Database PE2 must be started on remote server
    Log on to remote server and start database
    WARNING[E] 2011-06-10 16:31:46.355
               CJSlibModule::writeError_impl()
    CJS-20022  Could not start instance 'DVEBMGS01' of SAP system PE2.
    TRACE      2011-06-10 16:31:46.355 [iaxxejsbas.hpp:408]
               handleException<ESAPinstJSError>()
    Converting exception into JS Exception EJSException.
    TRACE      2011-06-10 16:31:46.355
    Function setMessageIdOfExceptionMessage: ind-rel.ind-os.ind-db.webas.startInstanceFailed
    WARNING[E] 2011-06-10 16:31:46.355
               CJSlibModule::writeError_impl()
    CJS-20022  Could not start instance 'DVEBMGS01' of SAP system PE2.
    TRACE      2011-06-10 16:31:46.355 [iaxxejsbas.hpp:483]
               EJS_Base::dispatchFunctionCall()
    JS Callback has thrown unknown exception. Rethrowing.
    TRACE      2011-06-10 16:31:46.405 [syuxctask.cpp:1382]
               CSyTaskImpl::start(bool)
    A child process has been started. Pid = 25793
    ERROR      2011-06-10 16:31:46.525 [sixxcstepexecute.cpp:950]
    FCO-00011  The step start with step key |NW_ABAP_CI|ind|ind|ind|ind|0|0|NW_CI_Instance|ind|ind|ind|ind|10|0|NW_CI_Instance_Start|ind|ind|ind|ind|2|0|start was executed with status ERROR .
    TRACE      2011-06-10 16:31:46.555 [iaxxgenimp.cpp:752]
                CGuiEngineImp::showMessageBox
    <html> <head> </head> <body> <p> An error occurred while processing option SAP ERP 6.0 EHP4 Ready - Support Release 1 > SAP Application Server ABAP > Oracle > High-Availability System > Central Instance . You can now: </p> <ul> <li> Choose <i>Retry</i> to repeat the current step. </li> <li> Choose <i>View Log</i> to get more information about the error. </li> <li> Stop the option and continue with it later. </li> </ul> <p> Log files are written to /tmp/sapinst_instdir/ERPEhP4/AS-ABAP/ORA/HA/CI. </p> </body></html>
    TRACE      2011-06-10 16:31:46.555 [iaxxgenimp.cpp:1255]
               CGuiEngineImp::acceptAnswerForBlockingRequest
    Waiting for an answer from GUI
    Kindly let us know how to rectify the error and prroceed further with the instalaltion.
    Thanks
    Rishi

    Dear Guys,
    we didnt change the date and time but i m very sure it is same trans.log file.
    for your kind information please note SID and Nodes details
    Sid (PE2)
    DB Node : DBMDB001
    CI Node :   DBMCI001
    also i am attaching starting part of the file.
    4 ETW000 R3trans version 6.14 (release 701 - 26.01.09 - 12:46:00).
    4 ETW000 unicode enabled version
    4 ETW000 ===============================================
    4 ETW000
    4 ETW000 date&time   : 07.11.2010 - 03:44:06
    4 ETW000 control file: <no ctrlfile>
    4 ETW000 R3trans was called as follows: R3trans -d
    4 ETW000  trace at level 2 opened for a given file pointer
    4 ETW000  [dev trc     ,00000]  Sun Nov  7 03:44:06 2010                             295  0.000295
    4 ETW000  [dev trc     ,00000]  db_con_init called                                    22  0.000317
    4 ETW000  [dev trc     ,00000]  create_con (con_name=R/3)                            116  0.000433
    4 ETW000  [dev trc     ,00000]  Loading DB library '/usr/sap/PC1/SYS/exe/run/dboraslib.so' ...
    4 ETW000                                                                              64  0.000497
    4 ETW000  [dev trc     ,00000]  load shared library (/usr/sap/PC1/SYS/exe/run/dboraslib.so), hdl 0
    4 ETW000                                                                           32161  0.032658
    4 ETW000  [dev trc     ,00000]  Library '/usr/sap/PC1/SYS/exe/run/dboraslib.so' loaded
    4 ETW000                                                                              39  0.032697
    4 ETW000  [dev trc     ,00000]  function DbSlExpFuns loaded from library
    /usr/sap/PC1/SYS/exe/run/dboraslib.so
    4 ETW000                                                                             111  0.032808
    4 ETW000  [dev trc     ,00000]  Version of '/usr/sap/PC1/SYS/exe/run/dboraslib.so' is "700.08",
    patchlevel (0.25)
    4 ETW000                                                                             265  0.033073
    4 ETW000  [dev trc     ,00000]  function dsql_db_init loaded from library
    /usr/sap/PC1/SYS/exe/run/dboraslib.so
    4 ETW000                                                                              41  0.033114
    4 ETW000  [dev trc     ,00000]  function dbdd_exp_funs loaded from library
    /usr/sap/PC1/SYS/exe/run/dboraslib.so
    4 ETW000                                                                              82  0.033196
    4 ETW000  [dev trc     ,00000]  New connection 0 created                              52  0.033248
    4 ETW000  [dev trc     ,00000]  0: name = R/3, con_id = -000000001 state = DISCONNECTED, perm = YES,
    reco = NO , timeout = 000, con_max = 255, con_opt = 255, occ = NO
    4 ETW000                                                                              41  0.033289
    4 ETW000  [dev trc     ,00000]  db_con_connect (con_name=R/3)                         84  0.033373
    4 ETW000  [dev trc     ,00000]  find_con_by_name found the following connection for reuse:
    4 ETW000                                                                              31  0.033404
    4 ETW000  [dev trc     ,00000]  0: name = R/3, con_id = 000000000 state = DISCONNECTED, perm = YES,
    reco = NO , timeout = 000, con_max = 255, con_opt = 255, occ = NO
    4 ETW000                                                                              37  0.033441
    4 ETW000  [dev trc     ,00000]  Oracle Client Version: '10.2.0.4.0'                  601  0.034042
    4 ETW000  [dev trc     ,00000]  -->oci_initialize (con_hdl=0)                         25  0.034067
    4 ETW000  [dev trc     ,00000]  Client character set UTF16 -> UTF8                 35674  0.069741
    4 ETW000  [dev trc     ,00000]  Client NLS setting (OCINlsGetInfo): 'AMERICAN_AMERICA.UTF8'
    4 ETW000                                                                              57  0.069798
    4 ETW000  [dev trc     ,00000]  Logon as OPS$-user to get SAPSR3's password           55  0.069853
    4 ETW000  [dev trc     ,00000]  Connecting as /@PC1 on connection 0 (nls_hdl 0) ... (dbsl 700
    151208)
    4 ETW000                                                                              34  0.069887
    4 ETW000  [dev trc     ,00000]  Nls CharacterSet                 NationalCharSet              C     
    EnvHp      ErrHp ErrHpBatch
    4 ETW000                                                                              52  0.069939
    4 ETW000  [dev trc     ,00000]    0 UTF8                                                      0
    0x6000000001052910 0x600000000105a3c0 0x600000000106ab38
    4 ETW000                                                                              58  0.069997
    4 ETW000  [dev trc     ,00000]  Allocating service context handle for con_hdl=0       40  0.070037
    4 ETW000  [dev trc     ,00000]  Allocating server context handle                      27  0.070064
    4 ETW000  [dev trc     ,00000]  Attaching to DB Server PC1
    (con_hdl=0,svchp=0x600000000106aa68,srvhp=0x600000000106de78)
    4 ETW000                                                                              63  0.070127
    4 ETW000  [dev trc     ,00000]  Assigning server context 0x600000000106de78 to service context
    0x600000000106aa68
    4 ETW000                                                                           60612  0.130739
    4 ETW000  [dev trc     ,00000]  Allocating user session handle                        97  0.130836
    4 ETW000  [dev trc     ,00000]  Starting user session: OCISessionBegin(con_hdl=0,
    usr='/',svchp=0x600000000106aa68, srvhp=0x600000000106de78, usrhp=0x60000000010fc940)
    4 ETW000                                                                              64  0.130900
    4 ETW000  [dev trc     ,00000]  Assigning user session 0x60000000010fc940 to service context
    0x600000000106aa68
    4 ETW000                                                                            9302  0.140202
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=53, stmth_p=0x6000000001077608)
    4 ETW000                                                                             198  0.140400
    4 ETW000  [dev trc     ,00000]         BEGIN DBMS_APPLICATION_INFO.SET_MODULE(:A0,:A1); END;        
    4 ETW000                                                                              38  0.140438
    4 ETW000  [dev trc     ,00000]  CbApplInfoGet() failed! Ignore, but uninstall callback to avoid more
    erroneous calls
    4 ETW000                                                                             291  0.140729
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=54, stmth_p=0x6000000001078660)
    4 ETW000                                                                              33  0.140762
    4 ETW000  [dev trc     ,00000]         BEGIN DBMS_APPLICATION_INFO.SET_CLIENT_INFO(:A0); END;       
    4 ETW000                                                                              35  0.140797
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=0, stmth_p=0x6000000001078660)
    4 ETW000                                                                             937  0.141734
    4 ETW000  [dev trc     ,00000]         SELECT SID FROM V$MYSTAT WHERE ROWNUM<2                                                                               
    4 ETW000                                                                              36  0.141770
    4 ETW000  [dev trc     ,00000]  Connected to session 297.                            639  0.142409
    4 ETW000  [dev trc     ,00000]  Now '/@PC1' is connected: con_hdl=0, nls_hdl=0, session_id=297.
    4 ETW000                                                                              38  0.142447
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=0, stmth_p=0x6000000001078660)
    4 ETW000                                                                              37  0.142484
    4 ETW000  [dev trc     ,00000]         ALTER SESSION SET NLS_SORT = BINARY                                                                               
    4 ETW000                                                                              36  0.142520
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=0, stmth_p=0x6000000001078660)
    4 ETW000                                                                             327  0.142847
    4 ETW000  [dev trc     ,00000]         SELECT USERID, PASSWD FROM SAPUSER WHERE USERID IN (:A0, :A1)
    4 ETW000                                                                              36  0.142883
    4 ETW000  [dev trc     ,00000]  Got SAPSR3's password from OPS$-user                 728  0.143611
    4 ETW000  [dev trc     ,00000]  Disconnecting from connection 0 ...                   38  0.143649
    4 ETW000  [dev trc     ,00000]  Rolling back transaction ...                          31  0.143680
    4 ETW000  [dev trc     ,00000]  Closing user session
    (con_hdl=0,svchp=0x600000000106aa68,usrhp=0x60000000010fc940)
    4 ETW000                                                                             210  0.143890
    4 ETW000  [dev trc     ,00000]  Now I'm disconnected from ORACLE                     721  0.144611
    4 ETW000  [dev trc     ,00000]  Connecting as SAPSR3/<pwd>@PC1 on connection 0 (nls_hdl 0) ... (dbsl
    700 151208)
    4 ETW000                                                                              40  0.144651
    4 ETW000  [dev trc     ,00000]  Nls CharacterSet                 NationalCharSet              C     
    EnvHp      ErrHp ErrHpBatch
    4 ETW000                                                                              37  0.144688
    4 ETW000  [dev trc     ,00000]    0 UTF8                                                      0
    0x6000000001052910 0x600000000105a3c0 0x600000000106ab38
    4 ETW000                                                                              37  0.144725
    4 ETW000  [dev trc     ,00000]  Assigning username to user session: con_hdl=0,
    usrhp=0x60000000010fc940
    4 ETW000                                                                              35  0.144760
    4 ETW000  [dev trc     ,00000]  Assigning password to user session: con_hdl=0,
    usrhp=0x60000000010fc940
    4 ETW000                                                                              40  0.144800
    4 ETW000  [dev trc     ,00000]  Starting user session: OCISessionBegin(con_hdl=0, usr=SAPSR3/<pwd>,
    svchp=0x600000000106aa68, srvhp=0x600000000106de78, usrhp=0x60000000010fc940)
    4 ETW000                                                                             337  0.145137
    4 ETW000  [dev trc     ,00000]  Assigning user session 0x60000000010fc940 to service context
    0x600000000106aa68
    4 ETW000                                                                            4085  0.149222
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=54, stmth_p=0x6000000001077608)
    4 ETW000                                                                              63  0.149285
    4 ETW000  [dev trc     ,00000]         BEGIN DBMS_APPLICATION_INFO.SET_CLIENT_INFO(:A0); END;       
    4 ETW000                                                                              37  0.149322
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=0, stmth_p=0x6000000001077608)
    4 ETW000                                                                             585  0.149907
    4 ETW000  [dev trc     ,00000]         SELECT SID FROM V$MYSTAT WHERE ROWNUM<2                                                                               
    4 ETW000                                                                              36  0.149943
    4 ETW000  [dev trc     ,00000]  Connected to session 297.                            350  0.150293
    4 ETW000  [dev trc     ,00000]  Now 'SAPSR3/<pwd>@PC1' is connected: con_hdl=0, nls_hdl=0,
    session_id=297.
    4 ETW000                                                                              38  0.150331
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=0, stmth_p=0x6000000001077608)
    4 ETW000                                                                              38  0.150369
    4 ETW000  [dev trc     ,00000]         ALTER SESSION SET NLS_SORT = BINARY                                                                               
    4 ETW000                                                                              34  0.150403
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=0, stmth_p=0x6000000001077608)
    4 ETW000                                                                             294  0.150697
    4 ETW000  [dev trc     ,00000]         SELECT VALUE FROM V$NLS_PARAMETERS WHERE PARAMETER IN
    ('NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET') ORDER BY PARAM
    4 ETW000                                                                              66  0.150763
    4 ETW000  [dev trc     ,00000]         ETER                                                                               
    4 ETW000                                                                              34  0.150797
    4 ETW000  [dev trc     ,00000]  Database NLS settings: AMERICAN_AMERICA.UTF8         329  0.151126
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=0, stmth_p=0x6000000001077608)
    4 ETW000                                                                             856  0.151982
    4 ETW000  [dev trc     ,00000]         SELECT UPPER(INSTANCE_NAME),HOST_NAME,VERSION,TO_CHAR
    (STARTUP_TIME,'MON DD, YYYY, HH24:MI:SS') FROM V$INSTANCE           
    4 ETW000                                                                              36  0.152018
    4 ETW000  [dev trc     ,00000]  DB instance PC1 is running on scmdb001 with ORACLE version
    10.2.0.4.0 since NOV 07, 2010, 03:23:10
    4 ETW000                                                                             349  0.152367
    4 ETW000  [dev trc     ,00000]  -->oci_prepare_stmt(con_hdl=0, len=0, stmth_p=0x6000000001077608)
    4 ETW000                                                                              38  0.152405
    4 ETW000  [dev trc     ,00000]         SELECT SUBSTR(NAME,1,3), TO_CHAR(CREATED,'YYYYMMDDHHMMSS')
    FROM V$DATABASE

  • Unable to start Oracle BI server and Presentation Service

    I am unable to start the Bi Server and presentation service . I start stop, options in service window is coming disabled. Please can any body help on this?

    Hi,
    Please check if you have started the Oracle BI Java host service.
    Check if the OC4j is started.
    Check the event viewer logs. Also check on what account the service is starting.
    Hope this helps ...
    Thanks,
    Anita

  • SQL Server and Reporting Services

    What is the best practice for replicating the same reports for different clients using different databases in the same SQL Server and Reporting Services?
    For example:
    Create a single database for each client.
    Create a single data source in Reporting services for each client.
    Create a folder in Reporting Service for each client, and replicate all the report and point each report to its correct data source.
    Is there an easier method for this type of solution.

    Hi acedenoBI,
    According to your description, you have reports which has same structure for each user. Now you want to have a folder for each client to keep their reports. And each client should have a single database and single data source. Right?
    In Reporting Service, if we need one data source to connect different database dynamically, we may need to use parameter and create dynamic connection string. However, in this scenario, since we need to have a single folder and data source for each
    client, so we can just make copies of the whole project. Modify the Connection string in each data source, change the Initial Catalog to be the corresponding database for the client. This can be an easy way to meet the requirement.
    If you have any feedback on our support, please click
    here.
    Best Regards,
    Simon Hou

  • Pls Suggest server names for Reporting Server and Shared Services

    Hi,
    Can any one Pls Suggest server names for Reporting Server and Shared Services
    Thanks in advance.

    Report server name: OrclRpt
    Shared Services: OrclSS

  • RMI Server and Provider Services

    Hi Everyone,
    Can I know whats the role of Planning RMI server and Provider Services. On what specific situations do we need to restart those??
    Thanks in Advance

    Any help on this please!!

  • Powershell script for Exchange Server 2010 health check

    People,
    Can anyone here please share the Powershell to check the Exchange Server health and functionality after patching and Service Pack update?
    I need to test multiple servers in my AD environment.
    Thanks
    /* Server Support Specialist */

    Hi,
    In Exchange 2010, you can use the Test-ServiceHealth cmdlet to test whether all the Microsoft Windows services that Exchange requires on a server have started.
    A related article about this command.
    https://technet.microsoft.com/en-us/library/aa998852(v=exchg.150).aspx
    You can also use the EXBPA tool to do Exchange server health check. You can look at the blog below.
    http://blogs.msdn.com/b/douggowans/archive/2007/06/06/run-your-own-exchange-server-health-check-the-tools.aspx
    Hope this is helpful to you.
    Best regards,
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Belinda Ma
    TechNet Community Support

  • How to execute an SSIS package on a scheduled basis from remote server and pass in input files

    I have an application server and a db server.  My db server has all things SQL Server stored on it (DBMS, SSRS, SSIS, etc.)  I have several nightly batch process SSIS packages (dtsx files currently) that will pickup an input file and import them
    into the database.  I would like to execute all batch processes from my application server as I have quite a few other ones as well that do other stuff outside of SQL Server via powershell.  My question is how to do this?  Is there away to execute
    them remotely via DTexec.exe, should I set them up as Agent jobs and somehow pass in the file names\location (how?), create and SSIS catalog, etc.?  
    I need to easily be able to see if the packages execute successfully or not and if not capture the detailed information of why they failed from the remote server so I can use that to drive my process flow logic in the batch processes.

    Hi Jason,
    According to your description, you want to execute a package on a schedule and receive notification when package ends with error in the job.
    After testing the issue in my environment, we can directly add the package in a step of a job, then add a schedule and set the Alert and Notification property in the job to achieve your requirement. For more details, please see:
    Create a Database Mail in the SSMS.
    Right-click the SQL Server Agent services to Enable mail profile, then select the appropriate Mail profile.
    Under the Operators folder, create an operator with the correct E-mail name.
    Right-click the Jobs folder to add a new job.
    In the Steps pane, New a step with SQL Server Integration Services Package Type to run the package.
    In the Schedules pane, New a schedule for the job.
    In the Alerts pane, New an alert with SQL Server event alert, then enable Notify operators option with an operator in the Response pane.
    In the Notifications pane, enable Email option with same operator and When the job fails selection.
    Then when the package fails, the job would be failed and we can receive the error message in the mailbox.
    Besides, please make sure the account that execute the job has correct permissions for the file, for the folder that contains the file, and for the database.
    References:
    Configure Database Mail – Send Email From SQL Database
    How to setup SQL Server alerts and email operator notifications
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Powershell script for security groups and users for multiple share folders

    Hi scripting team,
    I need your help with powershell script for the below queries 
    1. List out the security groups for more than one server share path and output it to a file ( csv ) 
    For eg.
    If the are are two share paths 
    \\servername\foldermain\folder1
    \\servername\foldermain\folder2
    So I needs the list of security groups for each share path
    And the output needs to be under each any every path.
    2. Grab the users belongs to main security groups and it nested groups for more than one security group and listed the users under each and every group. No need to display nested groups. Just users belongs to main group and users under nested.
    Your teams help is much appreciated 
    Thank you.
    Thilochana kumararatne

    Hi Braham,
    Thanks for your quick reply.
    Are we able to do this on two stage method
    1. grab the security groups from the share paths
    if can grab the share path from a separate txt file than copying it to the <your path> location
    so i can modify the txt file
    once run the script
    if can the output like below to a CSV file
    \\servername\foldermain\folder1group 1group 2group 3\\servername\foldermain\folder2group 1group 2group 3then i know which groups belongs to which share paththen i can remove the duplicate groups and keep the common groups to grab the users belongs to itso with the second script same as the first copy the security groups to a txt file and the out put as below.what I needs is the users full name and the samaccount name ( user id )group 1user1user2user3
    group 2user1user2user3looking forward your help on thisThank you.Thilo

  • Execute script in remote server

    Hello ..
    My question, is there any built-in package can do the following:
    - Open connection from oracle database to remote server (windows server)
    - Execute script located in the remote server
    or anything can help to achieve this
    Thanks

    "or anything can help to achieve this"Your question is rather vague, so it's hard to know what "this" is.
    Anyway, there are two aspects to your question:
    1. running a script (presumably a .SQL script or similar).
    Oracle doesn't provide much in the way of built-ins to run scripts. Scripts are OS tools, and generally intended to be invoked from an OS agent (a shell script, SQL*Plus, etc). One option for running scripts is to build a Java Stored Procedure which mimics teh SQL*Plus HOST command. Tom Kyte has an example of this. Find it here: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:952229840241 Alternatively, as others have pointed out, DBMS_SCHEDULER supports running OS executables (since 10g). This would be a good solution if you want to run the script repeatedly, at definable times.
    2. accessing a remote directory
    The database can only access local directories. If you want it to be able to access a remote directory you will need to persuade your sysadmin or network admin to share the requisite drive and create a mapping to it on your database server.
    As for other ways of doing it, well the best way is to avoid the need for a script in the first place. Oracle has added a whole bundle of functionality to the database which increasingly render shell scripts obsolete. If you can explain what your script does we might be able to explain how to implement it as a pure PL/SQL solution.

  • SCOM 2012 - Use Powershell to put specific server and contained objects into Maintenance Mode

    I am still trying to develop what I thought was going to be an easy script, to put a specific server and all it's contained objects into maintenance mode in SCOM 2012.   Not a group, but just one specific server and all it's stuff.
    My script to START maintenance mode has two parameters:
    1.  The FQDN.  So for example: server1.contoso.com
    2.  The amount of minutes to put into maintenance mode
    Then it does the following to START maintenance mode:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $newEnd = ((Get-Date).AddMinutes($minutes))
    Start-SCOMMaintenanceMode -Instance $Instance -end $newEnd -Reason "PlannedOther" -Comment "Comments here"
    This seems to work from what I can tell.  I know that when you schedule maintenance mode manually in SCOM, there is an option to apply to "Selected objects and all their contained objects".  I do not know if that is occurring based on
    my code above.   But I think that is what I want to happen.   I just want all monitoring and alerting for the specified server to stop.   So if you think I need to change the above code so that it gets all the "contained
    objects" please let me know.
    The second part, which I know for a fact isn't fully working, is intended to stop maintenance mode for a server.
    My script to STOP maintenance mode has only one parameter:
    1.  The FQDN.  So for example: server1.contoso.com
    Then it does the following to STOP maintenance mode:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $MMEntry = Get-SCOMMaintenanceMode -Instance $Instance
    If ($MMentry)
    #basically sends an end time of 1 minute from when the script is run
    $newEnd = ((Get-Date).AddMinutes(1))
    Set-SCOMMaintenanceMode -MaintenanceModeEntry $MMEntry -EndTime $NewEnd -Comment "Removing from Maintenance Mode"
    This part does seem to work partially.   It does remove the server from maintenance mode.  However, I suspect that it's not removing all the "contained objects" from maintenance mode because when I run the script to stop maintenance
    mode on a server, the little maintenance mode icon in SCOM does go away but the overall light for the server stays set to "Not Monitored".   It never turns back to the green checkbox and says "Healthy".   When I start
    and stop maintenance mode manually I can see that the green Healthy checkbox comes back.  But when I try to run my above code to do it via script, it stays at "Not Monitored" instead.
    Can someone help me out here?  Looking for answers to two questions:
    1.  Does my Start maintenance mode code look ok? Will that put a server and all it's contained objects into maintenance mode?
    2.  What do I need to hadd to my Stop maintenance mode code, so that it correctly stops maintenance mode on the server and all its objects and everything starts to be monitored again?
    Thanks in advance!  Please let me know if you need any more information in order to be able to help me!

    Hello, thanks for your response.  Unfortunately, it does not appear that the link you provided works.
    As far as not including "selected objects and all their contained objects" I am wondering if there is a way for me to tell for sure. One thing I found was that if I run this script and put the server into maintenance mode, then I go into
    SCOM and click on Edit Maintenance Mode for that server, it shows me the details.   It has some comment, and my selected reason, based on the code I posted above.   It also DOES have "selected objects and all their contained objects"
    selected at top.  So it seems to me like it is working correctly, and does contain all the objects.   If you think that 'Edit' screen would be inaccurate for some reason, please let me know.  Or if you know of a way for me to check and
    confirm, please let me know that as well.
    As for REMOVING it from maintenance mode, I did eventually find a line of code that I think works.  Here's what my code looks like now:
    Import-Module OperationsManager
    $Instance = Get-SCOMClassInstance -Name $FQDN
    If ($Instance)
    $MMEntry = Get-SCOMMaintenanceMode -Instance $Instance If ($MMentry)
    $Instance.StopMaintenanceMode([DateTime]::Now.ToUniversalTime(),[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recursive);
    When I use the above code to STOP maintenance mode, the green checkmark does reappear for the server, and everything seems to be being monitored again.   Unlike before, where the maintenance mode icon would go away, but it would never change back
    to saying 'Monitored' again.  So I think that changing that one line to stop maintenance mode seems to have done the trick.
    So I guess my last concern now is just putting in maintenance mode initially, as I was talking about above.  If you still think the 'Edit Maintenance Mode' screen is not a good indicator of what my code does, please let me know.

  • I am connected to my remote server and "put files" but the web page files do not update, whats going on?

    I really can't figure this out:
    So I use a different computer at school for web design, I bought Dreamweaver to work on it at home, I get the files fine from the server that I uploaded at school but then I make changes at home computer and connect and "put" them and I check online and the web page doesn't change one bit.
    I don't have the exact file extensions from the computer at school but when I connect and get I have a similar folder(s) set up and then it downloads them into Dreamweaver file manager box and makes the folders there I downloaded. The site shows up fine in Dreamweaver after I "get" so great I thinking.
    But... not so fast, I change the page in Dreamweaver, preview n a browser and look right on so I "put", connect to server and upload. Then I check online an its still the same I uploaded the CSS and HTML and dependent files by dragging over and also using the up arrow "put" as well but nothing changes on the web page online.
    What is happening here I am so confused?
    Thanks a bunch, I mean I can still preview as I go but I really curious why my "put" files don't change my web page like at all!

    Have you tried refreshing the browser, or deleting the browser cache?

  • Calling stored procedure from script on remote server

    We are migrating our database to a virtual server environment. On the current dedicated environment, the database and scripts(calling stored procedures) are on the same server. In the new envoirnment, the scripts, input and output files will be on a different server. Does anyone have any examples of scripts on one server calling stored procedures on another server. Don't laugh, but the db server is currently running Oracle 9i (part of the new enviornment to move to 11g).

    brifry wrote:
    sorry my terminolgy is not correct. the stored procedure is in the database and the database is on server a. The script is on server b. In your example you show how to log onto the database. That I know. In your example your example, how would you point to server b so you can log onto the database?Do you want to mean that your procedure (location A) want to call a script from location B ?
    make the script located folder as shared and ,You may try this
    //server_name/folder_name/file_name.xxxHope this helps

Maybe you are looking for

  • How to find a transaction

    Hi all, I need to find a custom transaction. I know the name but if I write it within the key code it does'nt work... I'd like to put it in my favourites but it doesn't work as well... I don't think ther's a spelling mistake!! Does anybody know what

  • Error : ORA-00600 while executin query in WLS 6.1

    Hi, This is in regard to a error coming at the time of execution of a query, thru the application installed on Web Logic Server 6.1 java.sql.SQLException: ORA-00600: internal error code, arguments: [ttcgcshnd-1], [0], [], [], [], [], [], [] The same

  • Signature Problems - how to keep links and video capability after inserting signature in Reader

    I create inspection reports where the first page is a signed letter and the rest of the report is text, videos and links to pictures within the document (created in Adobe Acrobat X Pro).  When we sign the pdf in Reader XI the links and videos no long

  • I/O Error Result Code -36

    I'm trying to record a new track in an existing project, and every time a hit the record button I get an I/O Error Result Code -36. This is only happening in this particular project. If I open a new project I can record just fine. What does this mean

  • Web gallery albums missing

    Why does my web gallery say I have no published albums when, in fact, I have two that showed up yesterday?