Executing SCVMM PowerShell scripts via C# conditionally works depending on application type

I suspect that this is the wrong forum but I could not find one that was appropriate.
The environment is SCVMM 2012 R2. I have a series of PowerShell scripts that are executed via C# code from a variety of applications -- MVC, WCF, console, unit tests. It seems that successful connection to the VMM server is dependent on the type of application
being used. For example, console apps and WCF apps can connect successfully but the
same code running in a unit test or standard MVC app throw the following exception:
{You cannot access VMM management server SC-01. (Error ID: 1604)
Contact the Virtual Machine Manager administrator to verify that your account is a member of a valid user role and then try the operation again.}
    CategoryInfo: {ReadError: (:) [Get-SCVirtualMachine], CarmineException}
    ErrorDetails: {You cannot access VMM management server SC-01. (Error ID: 1604)
Contact the Virtual Machine Manager administrator to verify that your account is a member of a valid user role and then try the operation again.}
    Exception: {"You cannot access VMM management server SC-01.\r\nContact the Virtual Machine Manager administrator to verify that your account is a member of a valid user role and then try the operation again."}
    FullyQualifiedErrorId: "1604,Microsoft.SystemCenter.VirtualMachineManager.Cmdlets.GetVMCmdlet"
    InvocationInfo: Command = {Get-SCVirtualMachine}
    PipelineIterationInfo: Count = 0
    ScriptStackTrace: "at <ScriptBlock>, <No file>: line 1"
    TargetObject: null
I suspect that somehow, each app is running under different credentials but I cannot see how that is possible. Each app exhibits the stated behavior whether running within Visual Studio (w/ IIS Express) [running under my own account] or published to the
server running under a specific specified account that definitely has permissions to the VMM environment.
This behavior is easily reproducible with the following code
-- PS Script as embedded resource
Get-SCVirtualMachine -VMMServer "SC-01"
-- C# code to load and execute script
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management.Automation;
namespace LabManagement {
public class HyperVVirtualMachineManager {
public IEnumerable<Models.VirtualMachine> GetVirtualMachines() {
var vms = new List<Models.VirtualMachine>();
try {
using (var rs = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace()) {
rs.Open();
using (var ps = PowerShell.Create()) {
ps.Runspace = rs;
var assembly = System.Reflection.Assembly.GetExecutingAssembly();
var scriptName = "LabManagement.Scripts.GetAllVirtualMachines.ps1";
using (var s = assembly.GetManifestResourceStream(scriptName)) {
using (var reader = new System.IO.StreamReader(s)) {
var script = reader.ReadToEnd();
ps.AddScript(script);
var output = ps.Invoke();
if (ps.Streams.Error.Count > 0) {
foreach (var item in ps.Streams.Error) {
// do something
if (output.Count > 0) {
foreach (var o in output) {
// do something
rs.Close();
catch (RuntimeException ex) {
// do something
return vms;
-- Console app (Success)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VirtualLabManagement.ConsoleTests {
class Program {
static void Main(string[] args) {
// Arrange
var svc = new LabManagement.HyperVVirtualMachineManager();
// Act
var hosts = svc.GetVirtualMachines();
// Assert
-- Unit Test (Fails)
[TestMethod]
public void TestMethod1() {
// Arrange
var svc = new LabManagement.HyperVVirtualMachineManager();
// Act
var hosts = svc.GetVirtualMachines();
// Assert
Assert.IsNull(hosts);
As you can see, the code is exactly the same between the different executions but the ability to connect differs.

Hi Sir,
I would like to check the following items:
1. "a variety of applications -- MVC, WCF, console, unit tests." they are all installed on same computer?
2. VMM server still installed on same computer as these app resides in ?
(if it is possible please detail the topology of the environment )
If they are running at same account on same computer , I would suggest you to post this issue into Code UI forum for further assistance :
https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vstest
Best Regards,
Elton JI
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] .

Similar Messages

  • Executing powershell script via task scheduler

    Hello,
    I am trying to execute powershell script via windows task scheduler which will forcefully delete all email in a mailbox, but I am getting the below errors
    Operational Code - 2
    Task Category - Action Completed --- Task Scheduler successfully completed task "\IL98" , instance "{2b193375-cbd2-4986-918d-3cfd4027d6b6}" , action "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" with return code 0.
    Last Run Result - 0X0
    When I am adding additional cmdlets in the script "Set-ExecutionPolicy Unrestricted", I am getting Last Run Result 0X5 rest of the error remains the same.
    Powershell version - 3.0
    Task Scheduler version - 1.0
    If I try to run the script manually via Exchange Powershell the script executes without any errors
    Thanks in Advance,
    Ankush Shah

    I figured out the problem, there wasn't any problem with the script but I had to correct inputs in windows task scheuler
    Below is the resolution:
    Under Actions:
        Program/Script --> ws\System32\WindowsPowerShell\v1.0\powershell.exe
        Add Argument --> -noexit -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto
    ; <filepath>"
    Eariler I was writing the filepath after double quote "
    Also I have selected the option "Run with Highest Privilages" to avoid
    0x5 error

  • An unknown error occurred while executing the PowerShell script:

    Hello all,
    Not the most descriptive title, granted. I'm hoping this may prompt the next version toprovide additional valuable content.
    Kindly requesting any help on this problem. I'm running VMM 2012 R2 version 3.2.7668
    When I try to look at properties of an existing Private Cloud, I get this error, only if I "look" at certain attributes. If I stay away from the specific attributes, everything is hunky dory. For reasons unknown, after I get this error, I have
    to exit and go back into VMM in order to get anything else to run.
    The text in the error dialogue box is not entirely applicable because I was connected to the VMM server and will connect again, when I exit/relaunch.
    An unknown error occurred while executing the PowerShell script:
    The connection to the VMM management server scvmm2.mmmmmm.com was lost.
    Ensure that scvmm2.mmmmmm.com is online and that you can access the server remotely from your computer. Then connect to scvmm2.mmmmmm.com and try the command again using the new connection. Or, you can ensure that the Virtual Machine Manager service is started
    on scvmm2.mmmmmm.com. Then connect to scvmm2.mmmmmm.com and try the command again using the new connection. If the command fails again because of a connection failure, restart the Virtual Manager service and then try the operation again.
    Try the operation again. If the issue persists, contact Microsoft Help and Support.
    ID: 27235
    This is what I get in Events
    Warning 4/9/2015 3:27:04 PM PowerShell (Microsoft-Windows-PowerShell) 4100 Executing Pipeline
    Log Name:      Microsoft-Windows-PowerShell/Operational
    Source:        Microsoft-Windows-PowerShell
    Date:          4/9/2015 3:27:04 PM
    Event ID:      4100
    Task Category: Executing Pipeline
    Level:         Warning
    Keywords:      None
    User:          mmmmmm\paufra
    Computer:      tools-francis.mmmmmm.com
    Description:
    Error Message = The connection to the VMM management server scvmm2.mmmmmm.com was lost. (Error ID: 1610)
    Ensure that scvmm2.mmmmmm.com is online and that you can access the server remotely from your computer. Then connect to scvmm2.mmmmmm.com and try the command again using the new connection. Or, you can ensure that the Virtual Machine Manager service is started
    on scvmm2.mmmmmm.com. Then connect to scvmm2.mmmmmm.com and try the command again using the new connection. If the command fails again because of a connection failure, restart the Virtual Manager service and then try the operation again.
    Fully Qualified Error ID = 1610,Microsoft.SystemCenter.VirtualMachineManager.Cmdlets.GetSCReplicationGroupCmdlet
    Recommended Action = Ensure that scvmm2.mmmmmm.com is online and that you can access the server remotely from your computer. Then connect to scvmm2.mmmmmm.com and try the command again using the new connection. Or, you can ensure that the Virtual Machine Manager
    service is started on scvmm2.mmmmmm.com. Then connect to scvmm2.mmmmmm.com and try the command again using the new connection. If the command fails again because of a connection failure, restart the Virtual Manager service and then try the operation again.
    Context:
            Severity = Warning
            Host Name = Default Host
            Host Version = 4.0
            Host ID = 94963cd4-5979-4786-9da2-c8814de8c7c3
            Host Application = C:\Program Files\Microsoft System Center 2012 R2\Virtual Machine Manager\Bin\VmmAdminUI.exe
            Engine Version = 4.0
            Runspace ID = 359d7a46-3752-4929-8c09-0de4152d10e4
            Pipeline ID = 16
            Command Name = Get-SCReplicationGroup
            Command Type = Cmdlet
            Script Name =
            Command Path =
            Sequence Number = 91
            User = mmmmmm\paufra
            Shell ID = Microsoft.PowerShell
    User Data:
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-PowerShell" Guid="{A0C1853B-5C40-4B15-8766-3CF1C58F985A}" />
        <EventID>4100</EventID>
        <Version>1</Version>
        <Level>3</Level>
        <Task>106</Task>
        <Opcode>19</Opcode>
        <Keywords>0x0</Keywords>
        <TimeCreated SystemTime="2015-04-09T22:27:04.993655700Z" />
        <EventRecordID>285</EventRecordID>
        <Correlation ActivityID="{48059811-1A63-41E1-9057-7498D0E4FC20}" />
        <Execution ProcessID="2344" ThreadID="4076" />
        <Channel>Microsoft-Windows-PowerShell/Operational</Channel>
        <Computer>tools-francis.mmmmmm.com</Computer>
        <Security UserID="S-1-5-21-4008432563-1984933819-4238309236-2721" />
      </System>
      <EventData>
        <Data Name="ContextInfo">        Severity = Warning
            Host Name = Default Host
            Host Version = 4.0
            Host ID = 94963cd4-5979-4786-9da2-c8814de8c7c3
            Host Application = C:\Program Files\Microsoft System Center 2012 R2\Virtual Machine Manager\Bin\VmmAdminUI.exe
            Engine Version = 4.0
            Runspace ID = 359d7a46-3752-4929-8c09-0de4152d10e4
            Pipeline ID = 16
            Command Name = Get-SCReplicationGroup
            Command Type = Cmdlet
            Script Name =
            Command Path =
            Sequence Number = 91
            User = mmmmmm\paufra
            Shell ID = Microsoft.PowerShell
    </Data>
        <Data Name="UserData">
        </Data>
        <Data Name="Payload">Error Message = The connection to the VMM management server scvmm2.mmmmmm.com was lost. (Error ID: 1610)
    Ensure that scvmm2.mmmmmm.com is online and that you can access the server remotely from your computer. Then connect to scvmm2.mmmmmm.com and try the command again using the new connection. Or, you can ensure that the Virtual Machine Manager service is started
    on scvmm2.mmmmmm.com. Then connect to scvmm2.mmmmmm.com and try the command again using the new connection. If the command fails again because of a connection failure, restart the Virtual Manager service and then try the operation again.
    Fully Qualified Error ID = 1610,Microsoft.SystemCenter.VirtualMachineManager.Cmdlets.GetSCReplicationGroupCmdlet
    Recommended Action = Ensure that scvmm2.mmmmmm.com is online and that you can access the server remotely from your computer. Then connect to scvmm2.mmmmmm.com and try the command again using the new connection. Or, you can ensure that the Virtual Machine Manager
    service is started on scvmm2.mmmmmm.com. Then connect to scvmm2.mmmmmm.com and try the command again using the new connection. If the command fails again because of a connection failure, restart the Virtual Manager service and then try the operation again.
    </Data>
      </EventData>
    </Event>

    Hi Sir,
    First , please try to run the VMM configuration analyzer on that computer :
    http://www.microsoft.com/en-us/download/details.aspx?id=41555
    In addition , please try to use "VMMTrace" mentioned in following article to collect trace log and find some useful information :
    http://blogs.technet.com/b/jonjor/archive/2011/01/07/vmmtrace-simplified-scvmm-tracing.aspx
    Best Regards,
    Elton Ji
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] .

  • How to change maintenance powershell script via GPO?

    Per suggestion reposted from here: http://social.technet.microsoft.com/Forums/windowsserver/en-US/6eece9d6-a524-48aa-8e64-7554f0ec9b31/how-to-change-maintenance-powershell-script-via-gpo?forum=winserverGP
    Posted at http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/desktop-shortcuts-to-items-on-network-drives/94eddb27-342b-40fc-9ad4-677ff4ee8ebe?page=9&tm=1403700614489 originally.
    There is a very annoying "feature" in Windows 7 called BrokenShortcuts.ps1 which is being called out weekly via maintenance task and if it finds more than 4 "broken" network shortcuts it removes them all. So it means if a user at this
    moment is disconnected from the network he will lose all links to shares, network applications sitting on his desktop. Funny that there was no such script on Vista and i don't see this on Win8. On the post i have attached one user suggested to edit this script
    and change 4 to 500 or whatever high number. That's fine for one time fix. But i need to do this for 200+ users. This file cannot be simply replaced by a script, so i'm wondering is there any way to do it via GPO?
    I have already tried various startup scripts, but i'm not sure which user to put into commands.
    I need to run this on startup:
    takeown /F C:\Windows\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1
    icacls c:\windows\diagnostics\scheduled\maintenance\TS_BrokenShortcuts.ps1 /grant "some user":F
    copy \\share\folder$\TS_BrokenShortcuts.ps1 C:\Windows\diagnostics\scheduled\Maintenance\ /Y

    You need to take time to study how Windows does these things.  You can control them with GP which is what you asked.  The article shows you how to disable elements of the tasks.  Each task controls a script.  If you disable the task the
    script that deletes shortcuts will be stopped. Other maintenance tasks will continue to run.
    Most of your problem is that you seem to want someone to provide a magical solution.  In technology it is necessary to fully research your issues until you understand all aspects.  After fully studying the issue you should understand the possible
    solutions if they exist.
    You claim to have deployed the patch that Microsoft released to fix the issue.  You claim it didn't work.  If that is the case then you need to call MS and \p[en a support incident.  If  Microsoft determines that you are right about the
    patch not working you will not be charged for the call.
    I know that learning how to support technology is hard and frustrating for newcomers.  In time, by using these incidents to learn, you will become a seasoned technician and all of this will seem trivial.  Until then we can only suggest that you
    do things that most of us are familiar with.  We cannot fix your network for you.
    I think you haven't really posted in the GP forum but posted a question about GP in the server forum.  Try posting in the GP forum.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverGP
    Here is one answer from the GP forum:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverGP
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/600ca14f-8b1b-400c-b27f-a7f5733407ac/windows-scheduled-maintenance-task?forum=winserverGP
    ¯\_(ツ)_/¯

  • Can we execute a Powershell script from the Javascript?

    Hi,
    I have a certain requirement to add a Custom ribbon button in document library and there was a powershell script to be run for the selected item in the library.
    I have struck with executing a Powershell script from the javascript function.
    Can anyone please suggest me if this was achievable
    Thanks, Swaroop Vuppala

    Hi Swaroop,
    To execute server side code in a custom ribbon button script, using application page is a common way to do this, besides, you can also use a page dialog, which is similar with application page but display as model dialog, another way is javascript
    _dopostback and delegate control, the following article contains detailed information about this, please refer to it for more information:
    Invoke server side code on SharePoint ribbon click:
    http://sharepointnadeem.blogspot.in/2012/07/invoke-server-side-code-on-sharepoint.html
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Executing a powershell script for checking duplicate users while creating a AD user throug ADUC console.

    Hi,
    I have a text file in which some SamAccountNames are present.I need to check the file while creating a new users through ADUC console.If a username that is going to create through ADUC console is present in the file, then it should prompt a message
    that the user is already present in the text file.
    Is there any possibility of contacting the powershell script from the ADUC console.If so, then while creating a new user through ADUC console, what is the proceedure for executing that powershell script.
    please provide me the approriate solutions.
    Thanks
    Prasanthi k

    Run the below Powershell Script for users are exist or not in AD. Later you can create the users.
    #Find Users exist in AD or Not?
    #Biswajit Biswas
    $users = get-content c:\users.txt
    foreach ($user in $users) {
    $User = Get-ADUser -Filter {(samaccountname -eq $user)}
    If ($user -eq $Null) {"User does not exist in AD ($user)" }
    Else {"User found in AD ($user)"}
    Active Directory Users attributes-Powershell
    http://gallery.technet.microsoft.com/scriptcenter/Getting-Users-ALL-7417b71d
    Regards~Biswajit
    Disclaimer: This posting is provided & with no warranties or guarantees and confers no rights.
    MCP 2003,MCSA 2003, MCSA:M 2003, CCNA, MCTS, Enterprise Admin
    MY BLOG
    Domain Controllers inventory-Quest Powershell
    Generate Report for Bulk Servers-LastBootUpTime,SerialNumber,InstallDate
    Generate a Report for installed Hotfix for Bulk Servers

  • How to open IE browser in private mode with powershell script? $ie = New-Object -com internetexplorer.application

    How can I open IE, in inPrivate Browsing mode using PowerShell script?
    $ie = New-Object -com internetexplorer.application;
    $ie.visible = $true;
    $ie.navigate2("http://bing.com");
    while ($ie.Busy -eq $true) { Start-Sleep -Milliseconds 1000; }
    Ramana

    Hi
    Venkata,
    I’m writing to just check in to see if the suggestions were helpful. If you need further help,
    please feel free to reply this post directly so we will be notified to follow it up.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support

  • VA02: protect a line in condition screen depending on a type condition

    Hi all,
    I need to protect a line in condition screen depending on a type condition
    using the transaction VA02.
    Does anybody know the user-exit to do this ?
    I thank you in advance.
    Best Regards.
    Paolo

    Hi,
    I believe you cannot do it on condition basis...unless if you want to modify standard sap code.
    In the condition type config V/06..In the "changes which can be made" section there is an input for manual entries...there you can give D to not allow to change the condition ...
    Thanks
    Naren

  • Execute PowerShell Scripts via SAP NetWeaver Identity Management

    Hello,
    Has anyone implemented the execution of a PowerShell script from SAP NetWeaver Identity Management (7.1, 7.2, 8.0?).  Currently implementing 8.0, and our client is looking to kick off PowerShell scripts that would generate Active Directory accounts, Exchange accounts etc.
    Thanks!

    Hey Brendan,
    We've done this out of a 7.2 implementation for exchange 2010 admin processes.  We started with running powershell via a command line pass.  It worked pretty well but it wasn't plain sailing.  We used positional parameters to pass data to the scripts in question, we also had to come up with a return process that deals with any errors that might come of the powershell session.  We had some issues with the shell sessions closing after the script completed.
    We've since redesigned and now drop flat files to a constantly running powershell script that acts a bit like an IDM dispatcher (but obviously not integrated with IDM).  It kicks off other powershell sessions and monitors their progress allowing it to process time outs, stack work up, etc.
    We also found timing the processes to be an issue.  If you create an AD account in IDM and then try to immediately move onto mailbox enable (for example) the account we created wasn't yet replicated to exchange so we had to build wait time into various parts of the process.
    Thanks,
    Pete.

  • Executing powershell scripts via Task Scheduler

    Hi,
    I have a powershell script that I wrote that when executed from the shell works fine but when executed from task scheduler does not work.
    In my script, an email is sent out based on the results of the execution.  When I run this from the shell, email goes out, when scheduled, no email and there is no indication of errors having occurred anywhere in the system.
    Has anyone run into a similar issue?
    I did change my powershell execution policy to be unrestricted (both in the x86 and x64 consoles).  I am running Windows 2008 R2.
    Thanks - Greg.

    Hi,
    In addition the above suggestions, please also refer to the below threads:
    Using Task Scheduler for a powershell script on server 2008
    http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/e298d613-47b8-4492-92d1-0b55cc8497c1
     Using Windows Task Scheduler to execute Powershell Script frequently
    http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/5901a6ad-ba18-4817-82a9-f75d2d6b439f
    Hope this helps.
    Best Regards,
    Yan Li
    Yan Li
    TechNet Community Support

  • Executing PowerShell script via JAVA

    Hi,
    I have simple powershell script as below :
    # Filename: Hello.ps1
    Write-Host
    Write-Host 'Hello World!'
    Write-Host "Good-bye World! `n"
    # end of script
    I wish to run this script via JAVA by the below JAVA code -
    import java.io.*;
    public class PsJava {
    public static void main(String[] args)
    throws IOException{
            Runtime runtime = Runtime.getRuntime();
    String cmds = (String)
    "cmd /C powershell C:/Documents and Settings/vvenkata/My         Documents/Hello.ps1";
            Process proc = runtime.exec(cmds);
            proc.getOutputStream().close();
            InputStream inputstream = proc.getInputStream();
                InputStreamReader inputstreamreader =
    new InputStreamReader(inputstream);
                BufferedReader bufferedreader =
    new BufferedReader(inputstreamreader);
    String line;
    while ((line = bufferedreader.readLine()) != null) {
                System.out.println(line);          
    Thanks
    Now, why is that I am not able to see any print statements from Hello.ps1 ? Can anyone help me on this?

    Hi,
    I have place my powershell script in the 'C' directory. and i have changed my JAVA code as below, but it still doesn't give any output in my Eclipse Console.
    import java.io.*;
    public class PsJava {
    public static void main(String[] args)
    throws IOException{
            Runtime runtime = Runtime.getRuntime();
    String cmds = (String)
    "cmd /c powershell c:/Hello.ps1";
            Process proc = runtime.exec(cmds);
            proc.getOutputStream().close();
            InputStream inputstream = proc.getInputStream();
                InputStreamReader inputstreamreader =
    new InputStreamReader(inputstream);
                BufferedReader bufferedreader =
    new BufferedReader(inputstreamreader);
    String line;
    while ((line = bufferedreader.readLine()) != null) {
                System.out.println(line);          
    Please advice me on this. If I have to create a batch file, then can you let me know how do I do that?
    Thanks

  • Context Menu to Execute a powershell script within selected directory.

    Hi,
    I'm trying to run a powershell script from a context menu, I've been able to create a context menu, however, when I attempt to run the script it will only run at the default location. What I'd like to do is right-click a folder then click "Do Script"
    and have it run the script with the location set to the directory I right clicked.
    So for clarities sake, if I right click C:\example then when the script runs it should recognize .\ as C:\example
    This is what I currently have in my registry entry. However it's shouting about how there is no parameter for Set-Location that matches -File, I can see that it's taking the Set-Location command, then it's trying to see if -File will is a perameter for it,
    but I' trying to use -File for the powershell command. Anyone have any ideas for that?
    PowerShell -Command "Set-Location -LiteralPath '%V'" -File C:\script\Test.ps1
    Any ideas? I'm wondering if there is something in Powershell like how Bash has something like this to do commands inline
    $ > Command -parameter <arg> && Command -parameter <arg>

    To setup a script to launch in a men from within a context menu you must create a the following.
    Create the following keys:
    HKEY_CLASSES_ROOT\Directory\Shell\<Script Name>
    HKEY_CLASSES_ROOT\Directory\Shell\<Script Name>\command
    Within <Script Name> change the (Default) value to the words you want to have as a context menu example, "Launch Script Here".
    Within the command Key change the (Default) value to
    PowerShell.exe -File "C:\Script_location\script_name.ps1" "%v"
    PowerShell.exe is executed with the -File flag followed by the scripts exact location and "%v " is a variable pointing to the location that was selected.

  • Running a Powershell script via IIS on client machine

    Hello,
    I have a Powershell script that I want to serve to clients that will access my site.
    The script is simple - it will terminate Outlook and Communicator and restart in Cleanfreebusy mode.
    Researching this has noted that there is an IIS plugin that will allow the running of Powershell scripts?
    I would like to ask you, colleagues, is there a way I may be able to do this? That is to allow my clients run this Powershell script without downloading locally.
    Many many thanks,

    I have somewhat of a similar process, where I asked on the ASP.NET forums, as I needed my users of an Intranet site to be able to have a script run with the click of the button. I was told that it was not possible, as the browser is built to not allow stuff
    like this for security reasons.
    I haven't heard of a plugin so maybe there are other ways, but what I actually had to do, was create a batch file, and than on my webpage I added an IFrame
    <iframe id="myIframe" runat="server"></iframe>
    Than either in the html markup you can set the src attribute (I did mine in the code behind), to the directory where the file is at, so for instance \\myserver\fileishere
    Obviously the location needs to be shared and allow all users read/execute. This will display the file on the web page, and then the users, just double click it and it executes.
    You can possibly have a batch file that calls powershell and the script, but the script will need to be downloaded to the users machine, so it may be easier to find a batch equivallent of your powershell script and use DOS commands
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

  • Execute a powershell script from a windows store apps

    Hello Everybody !
    I'd like to launch a powershell script from a windows store apps.
    In fact the purpose is install a windows store apps from an other windows store apps.
    Any ideas?
    Thanks

    If it's a sideloaded LOB application, you can do this using a brokered component:
    http://blogs.msdn.com/b/wsdevsol/archive/2014/04/14/cheat-sheet-for-using-brokered-windows-runtime-components-for-side-loaded-windows-store-apps.aspx
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Recovery Task - SCOM, execute large Powershell scripts

    Hi,
    As a standard we use powershell for scripting. Now we want to do this in SCOM to.
    But on a recovery task i can only add one sentence of powershell commandline, or a VBscript. This is really strange for a monitoring tool, that has got so much powershell cmdlets.
    As a workaround i can execute powershell in the VBS code. But then i need to place my script on the server where the alert came from to resolve it.
    Now we want to send an SMS as a recovery task, so that the engineer knows there is an issue after working time.The problem is with the workaround is that i now need to give all application servers an 'accept' on the firewall to our SMS provider. Instead
    of 3 management servers.
    Has anybody got a good solution to start a powershell taks as a recovery on your management server for a application server to solve an issue or to send an SMS.
    Kind regards,
    André

    Hi
    I have two question:
    1- Which module did you use for your recovery task? because you said that you can only add one sentence of power-shell command-line,
    or a Vb-script. if you used regular recovery task module you can run a long script of power-shell or vb-script.
    2- Do you want to run that recovery task script on RMS or agents? Because if you want to run script on RMS it's so easy and you have to just create
    a normal vb-script recovery task module and call your SMS provider in it. Or in vb-script you have to call a power-shell script that located on RMS. 
    Another way is creating power-shell recovery task module and call your SMS provider in it.
    If you answer these questions I can help you better and more.
    regards
    Alireza

Maybe you are looking for

  • Indesign CS3: How to get the UID of the selected object?

    Hello, How can I get the UID of the selected object in an document? Thanks, Alois Blaimer

  • BPC Detail error/reject log not created in the PrivatePub/user/temp folder

    Hi, We have a custom import package that imports data from a comma seperated txt file in to BPC. If all the data members in the data file are valid dimension members the package is successful and the package log file is created in the PrivatePub/user

  • Error building blink Win IoT

    Cannot find forum for Win IoT so added to the closest I could find. Hi anyone experienced this error when building the Blinky example ? 1>------ Build started: Project: Galileo Wiring App1, Configuration: Debug Win32 ------ 1>A task was canceled. 1>A

  • BEx analyser tool tip in German

    Hi Gurus In one of the user's desktop, the tool tips for icons in BEx Analysers are displayed in German language.  This happens when she starts her desktop in the morning, but goes away when she runs a RADIA package. Is there anyway, we can make the

  • ADF HumanTask Support

    Hi, I am new to ADF. I have composite application with BPEL contains human task. I know through BPM worklist (http://localhost:7001/integration/worklistapp) I can access the task details and perform actions. But as per my requirement, I SHOULD not us