Trying to added o365 licenses via powershell command line

I am trying to add o365 licenses to current users in the cloud.  I am using the following command.
Set-MsolUserLicense -UserPrincipalName
 (get-content c:\temp\o365.txt) -AddLicenses "companyName:ENTERPRISEPACK"
Above statement works as long there is only 1 line in the o365.txt file.
As soon as I add a second line.  I get the following error message.
Set-MsolUserLicense : Cannot convert 'System.Object[]' to the type
'System.String' required by parameter 'UserPrincipalName'. Specified method is
not supported.
At line:1 char:41
+ Set-MsolUserLicense -UserPrincipalName  (get-content c:\temp\o365.txt)
-AddLicen ...
+                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-MsolUserLicense], Para
   meterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Online.Administr
   ation.Automation.SetUserLicense
all help is appreciated.

Hi
Perhaps something like this:
Set-MsolUserLicense -UserPrincipalName $UPN -AddLicense $AccountSKU -Licenseoptions $NeededSKU
where $UPN is the variable which contains the list of user upn's
          $AccountSKU is the MSOLAccountSKU (domainname:ENTERPRISEPACK)
          $NeededSKU is the custom License options you created using new-MsolLicenseOptions command.
Hope this helps. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

Similar Messages

  • How to set Full Crawl Schedule as None via Powershell command

    How to set Full Crawl Schedule as None via Powershell command

    $ssa = "Search Service Application"
    $contentSource = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $ssa -Identity "Local SharePoint Sites"
    $contentSource.IncrementalCrawlSchedule = $null
    $contentSource.FullCrawlSchedule = $null
    $contentSource.Update()
    Basically you set Schedule to Null.
    Amit

  • HT1428 How to change the account name in Mac OS X via a command line. I did a type-o on the account name. So instead of it saying "Company" it says "Comany"  for the account logon.

    How to change the account name in Mac OS X via a command line. When I created the account I mistyped the name. I have a management suite where I can execute remote scripts. I would like to run a script that changes the name from oldname to newname.
    None of these Macs have been used currently.
    Thank you,
    Brian

    If user account shortname, see Changing user account shortname

  • Launch remote control via a command line?

    Is is possible to launch a remote control session via a command line as well
    as the other "remote actions"?
    Thanks,
    Bryan

    On Wed, 29 Sep 2004 22:25:17 GMT, Bryan Miller wrote:
    > Is is possible to launch a remote control session via a command line as well
    > as the other "remote actions"?
    take a look at the online documentation which describes this..
    Marcus Breiden
    Please change -- to - to mail me.
    The content of this mail is my private and personal opinion.
    http://www.edu-magic.net

  • Fail to build SSIS/SSAS projects via VS2012 command line (devenv.exe) with SSDT BI tool installed

    Hello,
    I installed recently released SSDT BI tools for VS2012 and I can work on my existing SSIS/SSAS projects all well in VS2012. But when I try to build my SSIS/SSAS projects via the command line of VS2012, such as
    devenv.exe mySolution.sln /rebuild Release /out "C:\temp\buildLog.txt"
    I will get the error like below in the log file.
    Error: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
    Is this a known issue? If yes, any fix has been planned?
    Thanks
    Jimmy

    Hi Jimmy Jin,
    This sounds like .NET framework problem, please refer to:
    http://bchavez.bitarmory.com/archive/2007/08/23/catastrophic-failure-exception-from-hresult-0x8000ffff-e_unexpected.aspx
    http://bchavez.bitarmory.com/archive/2007/08/23/catastrophic-failure-exception-from-hresult-0x8000ffff-e_unexpected.aspx
    Thanks,
    Eileen
    If you have any feedback on our support, please click
    here
    Eileen Zhao
    TechNet Community Support

  • Setting proxy servers via the command line

    I am looking to find out how to set up the system to use http and https proxies via the command line instead of through system preferences. How do I do this. I have basic command line knowledge.

    This information is stored in a plist file and is easiest to manipulate with PlistBuddy. For example, to set the HTTP proxy name, use:
    /usr/libexec/PlistBuddy -c "Set NetworkServices:6CFBA910-E4A0-4418-82E5-66A6480EBC71:Proxies:HTTPProxy http://my.proxy.com" /Library/Preferences/SystemConfiguration/preferences.plist
    Note: 6CFBA910-E4A0-4418-82E5-66A6480EBC71 is a UUID and likely to be unique on each machine. I don't have another Mac handy to check this. If so, you'll need to do some heavy to find out which one is the interface you need to address.
    Try man PlistBuddy and/or a web search for more information on how this tool can be used.
    Try man PlistBuddy or a web searc for more info on using it.

  • Can I manage resource designates via the command line?

    I would like to manage resource designates via the command line and
    the <i>"unires"</i> command does not seem to have this function. Could I use
    <i>"uniadmrights"</i>?
    # uniadmrights -e -add -resrc -n 10000
    <br>
    -e modify user rights, search filter
    <br>
    -add set user right on (-e only, default)
    <br>
    -resrc resource administration
    <p>
    The <I>uniadmrights</I> command is not able to assign designate rights. You can assign
    rights such as the ability to create and manage public and administration
    groups. The "Resource administration" flag exists so far only on the
    server side, and it is currently not used by the client. This is for future use.
    <p>
    There are two ways to assign a designate to a resource:
    <ol>
    <LI>Log on as the resource via the client. There are only a few commands
    available, one of them being the "Access Rights".
    <P>
    <LI>On the server side:
    <P>
    Edit the /users/unison/misc/resource.ini
    file and create a new section to specify the resource designate.
    <P>
    [DES]
    Designate0 = S=Lastname/G=Firstname
    <P>
    Run the unires command as follows:
    <P>
    % unires -mod "R=resourcename" -s DES 10000
    [sysOpPsw]
    </OL>
    <P>
    <B>Note:</B> The full resource name should be used eg. "R=Resource/N=1/CA=2/ID=2
    57"

    This sounds like a job for wget . You'll have to build and run it on Unix or Cygwin.
    You could also build a test suite to do this in various testing tools. You could even write a short Perl or Groovy script to do this, or a slightly longer Java class.

  • Invoking Powershell modules on remote clients via package/command line

    Hello Everyone -
    I have two modules(functions) that i've written and tested successfully locally in my environment that give me Uninstall and Repair functionality on whatever the string contains. Both .psm1's are delivered via a SCCM pkg that lands both into folders
    in the Modules directory. My issue is I can't seem to invoke this in a deployment scenario...as i'd like to deliver the "Invoke-command" using SCCM's command line to simply say...
    Invoke-Command -scriptblock { Do-This "<string>" }
    The above command works fine locally when...(exePol is set to Bypass).
    1.)Modules have respective folders living in WindowsPowershell\Modules directory named xxxx.psm1
    2.)Import-Module -name <path\name of module>
    3.)Verify Modules are loaded(moduleType is script)
    But when fabricating the folders\files above with SCCM, and running the Invoke-Command(in many different ways remotely), i recieve the cmdlet, program doesn't exist and has no idea what i'm talking about. Folders\Files for .psm1's are present and do
    show when running Get-Module -Listavailable locally on targeted clients.
    Maybe this is related to the Import-Module command and the context i'm trying to delivery it in?
    I've tried multiple scenario's of...
    A.) Psexec that launches powershell, followed by the Import-Module -name <path\name of module>
    B.) .Bat file that launches powershell with the same Import-Module syntax
    C.) PS1 that includes the same Import-Module line.
    D.) Just straight from the command line of the Pkg/Program.
    Has anyone tried this? Is there a better method when trying to deliver invoke-command on a module/function to a client via SCCM? 
    TIA 

    [I see that the you are running the powershell.exe and then importing the module in the command line for the Program you created in SCCM, so just importing the module will do the repair action for you ??]
    Not sure how else i would run a Import-Module without calling upon powershell.exe. The reason for using Import-Module first is it only creates the abilty of whatever the module(function in this case) on the client. So if i can get the remote
    Import-Module to work, which would then allow me in the future to use an Invoke-Command -scriptblock { Do-This "string" } on the clients. In this case its both an Uninstall and Repair function with an assortment of switches and arguements that will aide me
    in the future in managing our apps. For me to use the Modules, i would need to Invoke-Command as that is how the functions are built.
    Okey so the module does get dumped to the end machine.
    Suppose you have a test machine TEST01 where the Test.psm1 file  (having Test-Function)is delivered through SCCM.
    Then try this and tell if it works:
    PS C:\> $session = New-PSSession -ComputerName TEST01
    PS C:\> Invoke-Command -Session $session -ScriptBlock {Import-Module Test.psm1 }
    PS C:\> Invoke-Command -Session $session -ScriptBlock {Test-Function #inside your Module}#Or Simply try below:
    PS C:\> Invoke-Command -ComputerName TEST01 -ScriptBlock {Import-Modules Test.psm1;Test-Function #inside your Module}
    I think what you are doing is below.....for the example am taking "webadministration" module:
    PS C:\> Invoke-Command -ComputerName Server01 -ScriptBlock {Import-Module web*}
    PS C:\> Invoke-Command -ComputerName Server01 -ScriptBlock {get-website}
    The term 'get-website' 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.
    + CategoryInfo : ObjectNotFound: (get-website:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    + PSComputerName : sdwuweb017
    Point here is you need to import the module and work with it in an already opened session....If you specify a computername every time then PowerShell opens the Session does what you want it to do and tears down the session. To persist the importing of the
    module it must be done in a session which we make using New-PSSession and then run the commands against that session.
    I might have misunderstood the problem but this is what I have got so far.
    Hope this helps
    Knowledge is Power{Shell}.

  • Deploying via powershell command from AppV Management Server 5.0

    Hello All,
    Good day!
    I am having hard time in deploying an application from AppV Management Server 5.0 using Powershell command.
    I have an application which works in Standalone client machine and even from SCCM 2012(AppV Deployment), whereas if I deploy that application from AppV server it is not working
    I am using this command line to deploy an application from AppV Mgmt server thru powershell command,
    Import-AppvServerPackage -PackagePath "<Path of .appv file>" –DynamicDeploymentConfigurationPath "<Path of DeploymentConfig.xml"> | Publish-AppvServerPackage -Verbose | Grant-AppvServerPackage -Groups "domain\AppV_Users"
    -Verbose
    is there anything wrong in the command which I used?
    When I run, am receiving this error.
    Import-AppvServerPackage : A parameter cannot be found that matches parameter name
    'DynamicDeploymentConfigurationPath'.
    At line:1 char:126
    + ... 1.0.3333.appv" –DynamicDeploymentConfigurationPath '\App_DeploymentConfig.xml'  ...
    +                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Import-AppvServerPackage], ParameterBindingException
        + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.AppV.Server.Cmdlets.ImportAppvServerPackageCommand
    whereas this command works, without DynamicDeploymentConfigurationPath
    Import-AppvServerPackage -PackagePath "<Path of .appv file>" | Publish-AppvServerPackage -Verbose | Grant-AppvServerPackage -Groups "domain\AppV_Users" -Verbose
    How do I direct my application to take the DeploymentConfig.xml file though powershell.
    I even tried to Import this xml from AppV Management console, even it did not work for me. 
    Kindly help me, your inputs needed.
    Any help would be greatly appreciated.
    Thanks in Advance!
    Regards,
    Raj

    Hi Falko,
    Thanks for your response.
    As you said, I tried to import the package and used set-appvserverpackage
    PS C:\Users\Administrator.xxxxxxxxxxx> Import-AppvServerPackage "\\appv\Content\Filezilla\Filezilla.appv"
    Id               : 15
    Name             : Filezilla
    Description      :
    PackageGuid      : e8720679-cc41-4578-98a4-32a382f790ef
    VersionGuid      : 296708bc-e07d-474a-bb46-1f09d9779a4c
    Version          : 0.0.0.1
    Enabled          : False
    Applications     : {}
    Entitlements     : {}
    ConnectionGroups : {}
    PackageUrl       : \\appv\Content\Filezilla\Filezilla.appv
    import was successful, when I try Set-Appvserverpackage am receiving the following error
    PS C:\Users\Administrator.xxxxxxxxxxx> Set-AppvServerPackage -DynamicDeploymentConfigurationPath "\\appv\Conte
    nt\Filezilla\Filezilla_DeploymentConfig.xml" | Publish-AppvServerPackage -Global
    Set-AppvServerPackage : Parameter set cannot be resolved using the specified named parameters.
    At line:1 char:1
    + Set-AppvServerPackage -DynamicDeploymentConfigurationPath "\\appv\Content ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Set-AppvServerPackage], ParameterBindingException
        + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.AppV.Server.Cmdlets.SetAppvServerPackageCommand
    I am going wrong somewhere...

  • Error while Seq vlc in powershell command line.

    Hi Team,
    when i am trying to seq Vlc i got below error in power shell.
    i have entered below command lines in powershell
    1. cd c:\install
    2. Set-ExecutionPolicy Unrestricted
    3. New-AppvSequencerPackage -FullLoad -Installer "C:\Install\vlc-2.1.3-win32.exe" -Name "Unknown_VLC_2.1.3_01_W7_32_A" -Pa
    th C:\Packages -PrimaryVirtualApplicationDirectory "C:\Windows" -TemplateFilePath .\AppV5SequencerTemplate.appvt -Verbo
    se
    after it's called "C:\Install\vlc-2.1.3-win32.exe", i did default install and clicked close button.
    after 5 mint's i got below error.
    could you please help me to solve.
    1. AppV5SequencerTemplate.appvt file present in c:\installer folder
    2. c:\packages folder created
    Thanks in Advance :)
    Ramesh
    PS C:\Install> New-AppvSequencerPackage -FullLoad -Installer "C:\Install\vlc-2.1.3-win32.exe" -Name "Unknown_VLC_2.1.3_01_W7_32_A" -Pa
    th C:\Packages -PrimaryVirtualApplicationDirectory "C:\Windows" -TemplateFilePath .\AppV5SequencerTemplate.appvt -Verbo
    se
    Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indi
    cation that other memory is corrupt.
    at PE.ComputeMinFileRanges(PE* )
    at ResolveDependencies(IPackageFile file, IEnumerable`1 files, Func`4 fnGetDependencyPathFromName, Func`2 fnGetLocalP
    athOfPackageFile, HashSet`1 dependencies, HashSet`1 visited)
    at Microsoft.ApplicationVirtualization.Packaging.PEScanner.BuildDependencies(IEnumerable`1 allPackageFiles, Func`2 pr
    edicate, Func`4 fnGetDependencyPathFromName, Func`2 fnGetLocalPathOfPackageFile)
    at Microsoft.ApplicationVirtualization.Packaging.StaticDependencyPackagingSubsystem.<>c__DisplayClass8.<.ctor>b__0(Ob
    ject sender, CommonPreEventArgs args)
    at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
    at Microsoft.ApplicationVirtualization.Packaging.PackagingEngine.OnFinalizePackage(Func`1 writerFactory)
    at Microsoft.ApplicationVirtualization.Packaging.PackagingEngine.<>c__DisplayClass18.<FinalizePackage>b__12()
    at Microsoft.ApplicationVirtualization.Packaging.WithAppCorruptionCheck.Execute(Action execute, Action`1 logCorruptio
    n)
    at Microsoft.ApplicationVirtualization.Packaging.WithAppCorruptionCheck.Execute(Action execute)
    at Microsoft.ApplicationVirtualization.Packaging.PackagingEngine.<>c__DisplayClass18.<FinalizePackage>b__11()
    at Microsoft.ApplicationVirtualization.Packaging.ExceptionGuard`1.Guard(Action logStart, Action execute, Action logEn
    d, Action`1 exceptionAction)
    at Microsoft.ApplicationVirtualization.Packaging.PackagingEngine.FinalizePackage(Func`1 writerFactory)
    at Microsoft.ApplicationVirtualization.Packaging.Packager.FinalizePackage(IPackageFiles packageFiles, String manifest
    Path, String registryHivePath, String streamMapPath, String packageHistoryPath, String installPath, String installShortP
    ath, String packagePath, CompressionOption compression, Predicate`1 addFileToPublishingFeatureBlock, PackagingEngineType
    engineType, PackagerParameters packageParameters)
    at Microsoft.ApplicationVirtualization.Packaging.Sequencing.PackagerAdapter.FinalizePackage(IPackageFiles packageFile
    s, String manifestPath, String registryHivePath, String streamMapPath, String packageHistoryPath, String installPath, St
    ring packagePath, CompressionOption compression, PackagerParameters packagerParameters)
    at Microsoft.ApplicationVirtualization.Packaging.Sequencing.PackagerOrchestrator.FinalizePackage(String streamMapPath
    , String packagePath, String manifestPath, String registryHivePath, String packageHistoryPath, String installPath, Compr
    essionOption compression, Boolean toAppendVersionNumberToFileName, PackagerParameters packagerParameters)
    at Microsoft.AppV.Modernizer.Cmdlets.NewAppvSequencerPackage.CreatePackageViaInstaller(String packageName, String out
    putDirectoryPath, String primaryApplicationVirtualDirectory, String installer, String templatePath, Boolean fullLoad, Fu
    nc`1 fnSequencerFactory, Func`2 fnMonitoringSessionManagerFactory, Func`1 fnSequencerStateFactory, Func`2 fnTaskScannerA
    dapterFactory, Func`2 fnPackagerOrchestratorFactory, Func`1 fnSequencerTemplateFactory, Func`2 fnExclusionListFactory, A
    ction`1 fnWait, Action fnConfigurePrivileges, Func`2 fnOutputDirectoryExists, Func`2 fnOutputSubdirExists, Action`1 fnCr
    eateDirectory)
    at Microsoft.AppV.Modernizer.Cmdlets.NewAppvSequencerPackage.CreatePackageViaInstaller(String packageName, String out
    putDirectoryPath, String primaryApplicationVirtualDirectory, String installer, String templatePath, Boolean fullLoad)
    at Microsoft.AppV.Modernizer.Cmdlets.NewAppvSequencerPackage.NewPackage()
    at Microsoft.AppV.Modernizer.Cmdlets.NewAppvSequencerPackage.<ProcessRecord>b__1()
    at Microsoft.AppV.Modernizer.Cmdlets.ExceptionGuard.Guard(Action logStart, Action execute, Action logEnd, Action`1 er
    rorAction)
    at Microsoft.AppV.Modernizer.Cmdlets.NewAppvSequencerPackage.ProcessRecord()
    at System.Management.Automation.CommandProcessor.ProcessRecord()
    at System.Management.Automation.CommandProcessorBase.DoExecute()
    at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorR
    esults, Boolean enumerate)
    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInterna
    l[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcCo
    ntext)
    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
    at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean crea
    teLocalScope, Dictionary`2 functionsToDefine, List`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Obj
    ect dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
    at System.Management.Automation.ScriptBlock.<>c__DisplayClassa.<InvokeWithPipe>b__8()
    at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
    at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, Dictionary`2 functionsToDefine, Lis
    t`1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis,
    Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
    at System.Management.Automation.ScriptBlock.InvokeUsingCmdlet(Cmdlet contextCmdlet, Boolean useLocalScope, ErrorHandl
    ingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Object[] args)
    at Microsoft.PowerShell.Commands.InvokeExpressionCommand.ProcessRecord()
    at System.Management.Automation.CommandProcessor.ProcessRecord()
    at System.Management.Automation.CommandProcessorBase.DoExecute()
    at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorR
    esults, Boolean enumerate)
    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInterna
    l[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcCo
    ntext)
    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
    at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object in
    putToProcess)
    at System.Management.Automation.CommandProcessorBase.DoComplete()
    at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstr
    eamCommandsToStop)
    at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorR
    esults, Boolean enumerate)
    at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInterna
    l[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcCo
    ntext)
    at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
    at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object in
    putToProcess)
    at System.Management.Automation.CommandProcessorBase.DoComplete()
    at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstr
    eamCommandsToStop)
    at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorR
    esults, Boolean enumerate)
    at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
    at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()
    at System.Management.Automation.Runspaces.PipelineThread.WorkerProc()
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object
    state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, B
    oolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    PS C:\Install>

    Thanks for your replay
    i have re- seq'd it's working..
    Thanks
    Er Reddy

  • Sending Reporting Services report via the command line

    I would like to either execute a subscription that sends a report via email on demand.  That or just email the report without having to edit the subscription date.  Can this be done from the command line?  I see there is the rs.exe utility
    that allows you to deploy reports and run configuration commands, but I would like to execute and email the report.  Is this possible?

    The easiest way to run a subscription manually is to run the agent job in SQL server that is associated to the subscription.  You'll need to know the subscription ID to do that.  So, you could either run it through SSMS, or if it needs to be in
    command line, interact with SQL Server via command line and do so.
    You can use the ReportService2010 API methods and and powershell script to identify the subscription ID
    https://msdn.microsoft.com/en-us/library/reportservice2010.reportingservice2010.aspx?f=255&MSPPError=-2147217396

  • How to initialize consumer from supplier via the command line ?

    We have a small directory that gets loaded from scratch every night.
    We also setted up replication to a couple of consumers (read only).
    The problem is that since the data is loaded everynight, we get compliants in logs "Replica has a different generation ID than local database"
    I can initialize the consumers via the gui. But how to do it from the command line from the master ? I know that an option is to do a db2ldif and then an ldif2db on the consumer but it's not an option for us.
    I also tried setting the nsds5beginreplicarefresh to start, but that doesn't seem to do a full init.
    There must be a way, as the gui actually does it.
    TIA

    Basically it's very simple. Supposing your replication is already setup and you reload data to your master. If you want the initialization pushed to all the replicas automatically, you can simply setup a flag in all the agreements. This flag is called nsDS5BeginReplicaRefresh.
    Please check the link:
    http://docs.sun.com/source/816-6699-10/confattr.html#18194
    nsDS5BeginReplicaRefresh
    Allows you to initialize a replica. This attribute is absent by default. However, if you add this attribute with a value of start, the server reinitializes the replica and removes the attribute value.
    Property
    Value
    Entry DN
    cn=ReplicationAgreementName,cn=replica,cn="suffixName",
    cn=mapping tree,cn=config
    Valid Range
    stop | start
    Default Value
    N/A
    Syntax
    DirectoryString
    Example
    nsDS5BeginReplicaRefresh: start
    Please note that this value is absent by default and will disappear whenever initialization to replica finished. Next time whenever you want it to happen again, use ldapmodify to set this flag up.
    Also, if you want this happen to all the master's replicas, you have to setup for all the agreements.
    I already tested and it turns out very magic.
    So what you should do is whenver your master get reloaded, when it gets finished, call ldapmodify to set the attribute to be "start".
    Hope it helps!

  • Problems with in/out points when submitting jobs via Terminal/command-line

    I've writting a GUI based script which allows a user to select a source Quicktime file, and will encode that file to multiple formats, and trims each destination based on specific timecode in/out points. However, I'm having problems getting the Compressor command-line interface to honor the in/out timecodes that I've explicitly set for multiple jobs within a single commandline.
    In other words, if I want to encode a source Quicktime between 01:00:00:00 and 01:00:29:23 with just ONE setting/destination, then the following commandline works:
    /Applications/Final\ Cut\ Studio/Compressor.app/Contents/MacOS/Compressor -clustername MHM -batchname CLI_BATCH -jobpath /Volumes/mel/temp/20120329/TEST_SRC.mov  -settingpath /Volumes/common/settings/compressor/M9_Slave/_Local_/OTWC.setting -destinationpath /Volumes/mel/temp/20120329/TEST1234_Testing30_OTWC.mov -in 01000000 -out 01002923
    But if I try to append multiple settings/destinations to the commandline, Compressor will only honor the -in/-out arguments which appear in the LAST -jobpath instance in the commandline.
    For example, the following commandline will properly encode the file to multiple destination files, using the appropriate .settings file, but it ignores the -in/-out points that were set for any -jobpath instance that appears before the last -jobpath instance (in other words, every file is output using 00:59:57:00/01:00:30:01 as the in/out points, instead of having the "*_OTWC.mov" file output using 01:00:00:00 as the in point)
    /Applications/Final\ Cut\ Studio/Compressor.app/Contents/MacOS/Compressor -clustername MHM -batchname CLI_BATCH -jobpath /Volumes/mel/temp/20120329/TEST_SRC.mov  -settingpath /Volumes/common/settings/compressor/M9_Slave/_Local_/OTWC.setting -destinationpath /Volumes/mel/temp/20120329/TEST1234_Testing30_OTWC.mov -in 01000000 -out 01002923 -jobpath /Volumes/mel/temp/20120329/TEST_SRC.mov -settingpath /Volumes/common/settings/compressor/M9_Slave/_Local_/HNN-HD.setting -destinationpath /Volumes/mel/temp/20120329/TEST1234_Testing30_HNN-HD.mov -in 00595700 -out 01003001
    It's wierd that everything else about this command-line syntax works as expected (and as explicitly stated in the Compressor -help output, which says "when submitting individual source files. (The) Following parameters are repeated to enter multiple job targets in a batch"), except for the -in/-out points.
    I've even tried quoting the -in/-out arguments using colons (e.g., -in "01:00:00;00") , but this doesnt appear to change the behavior.
    Is this a bug, or am I missing something here?

    I've writting a GUI based script which allows a user to select a source Quicktime file, and will encode that file to multiple formats, and trims each destination based on specific timecode in/out points. However, I'm having problems getting the Compressor command-line interface to honor the in/out timecodes that I've explicitly set for multiple jobs within a single commandline.
    In other words, if I want to encode a source Quicktime between 01:00:00:00 and 01:00:29:23 with just ONE setting/destination, then the following commandline works:
    /Applications/Final\ Cut\ Studio/Compressor.app/Contents/MacOS/Compressor -clustername MHM -batchname CLI_BATCH -jobpath /Volumes/mel/temp/20120329/TEST_SRC.mov  -settingpath /Volumes/common/settings/compressor/M9_Slave/_Local_/OTWC.setting -destinationpath /Volumes/mel/temp/20120329/TEST1234_Testing30_OTWC.mov -in 01000000 -out 01002923
    But if I try to append multiple settings/destinations to the commandline, Compressor will only honor the -in/-out arguments which appear in the LAST -jobpath instance in the commandline.
    For example, the following commandline will properly encode the file to multiple destination files, using the appropriate .settings file, but it ignores the -in/-out points that were set for any -jobpath instance that appears before the last -jobpath instance (in other words, every file is output using 00:59:57:00/01:00:30:01 as the in/out points, instead of having the "*_OTWC.mov" file output using 01:00:00:00 as the in point)
    /Applications/Final\ Cut\ Studio/Compressor.app/Contents/MacOS/Compressor -clustername MHM -batchname CLI_BATCH -jobpath /Volumes/mel/temp/20120329/TEST_SRC.mov  -settingpath /Volumes/common/settings/compressor/M9_Slave/_Local_/OTWC.setting -destinationpath /Volumes/mel/temp/20120329/TEST1234_Testing30_OTWC.mov -in 01000000 -out 01002923 -jobpath /Volumes/mel/temp/20120329/TEST_SRC.mov -settingpath /Volumes/common/settings/compressor/M9_Slave/_Local_/HNN-HD.setting -destinationpath /Volumes/mel/temp/20120329/TEST1234_Testing30_HNN-HD.mov -in 00595700 -out 01003001
    It's wierd that everything else about this command-line syntax works as expected (and as explicitly stated in the Compressor -help output, which says "when submitting individual source files. (The) Following parameters are repeated to enter multiple job targets in a batch"), except for the -in/-out points.
    I've even tried quoting the -in/-out arguments using colons (e.g., -in "01:00:00;00") , but this doesnt appear to change the behavior.
    Is this a bug, or am I missing something here?

  • How do I open a PDF to a specific page via the command line?

    Several questions about opening PDFs from the Mac OS X command line:
    1) How do I use the "open" command to open a PDF to a specific page? (I know I can open a document via: open doc_name.pdf)
    2) How do I use the "open" command to pass multiple arguments (page no, zoom scale, view mode, etc...) to open a PDF file in a specific manner?
    3) Does Preview handle the same parameters as Acrobat Reader? If not, what are the differences in options?
    I've spent hours searching for this answer and have come up dry. I've downloaded Adobe's "PDF Open Parameters" document -- it lists all of the parameters I need, however I can't get any of them to work from the command line.
    My goal: Open a PDF from the command line to a specific page. At first glance, I thought this would be simple to do and find -- however, after a lot of searching I haven't found an example on how to do it.
    Anyone have any experience doing this, and care to share?
    Much appreciated! ---> Kelsey

    I don't know of any way to do what you want using the 'open' command. It can probably be done with Applescript, which you could call from a shell script. The Preview application doesn't seem to be scriptable. I don't use Acrobat, so I can't tell you anything about that. Looking through the dictionaries of the apps I do have, it seems that Skim (another PDF viewer) has an AS 'page' class. Below are a couple of links that may get you started. Look for more specific guidance in Applescript forums.
    http://sourceforge.net/apps/mediawiki/skim-app/index.php?title=AppleScript
    http://links.tedpavlic.com/shell_scripts/skim

  • Powershell script sends e-mail in ISE but not from powershell command line

    I have created a script that generates a report of all users who do not have photos in Active Directory. The script runs and sends an e-mail to a distribution list. It runs fine in ISE, but I cannot run it from command line or as a scheduled task. Any suggestions
    what I am doing wrong?
    #Starts Powershell Snap-In
    Start-Transcript -path c:\Scripts\StaffWithoutPhotos.txt
    add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010 -erroraction silentlyContinue
    $mailboxes = $null
    $mailboxes = @(Get-Mailbox -OrganizationalUnit "Staff User Accounts" -ResultSize Unlimited | Where {$_.HasPicture -eq $False})
    Write-Host $mailboxes
    $report = @()
    foreach ($mailbox in $mailboxes)
    $mbObj = New-Object PSObject
        $mbObj | Add-Member -MemberType NoteProperty -Name "Display Name" -Value $mailbox.DisplayName
        $report += $mbObj
    Write-Host "Diagnostic Output"
    Write-Host "Before Mailbox value check"
    Write-Host $report
    Write-Host "After Mailbox Value check"
    if ($mailboxes -ne $null)
        Write-Host $report
        #Send the report generated to the e-mail list specified above
        $style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
        $style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
        $style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
        $style = $style + "TD{border: 1px solid black; padding: 5px; }"
        $style = $style + "</style>"
        #Start-Sleep -Seconds 5
        $smtpserver = "MAIL.contoso.com"
        $msg = new-object Net.Mail.MailMessage
        $smtp = new-object Net.Mail.SmtpClient($smtpServer)
        $msg.From = "[email protected]"
        $msg.To.Add("[email protected]")
        #$msg.To.Add("[email protected]") #Used for testing
        $msg.Subject = "Staff without Photos report"
        $msg.Body = "This report contains the list of users who do not currently have photos."
        $msg.Body += "<p>"
        $msg.Body += "After photos are available for these users please submit a request to have their accounts updated or send an e-mail to <a href='mailto:[email protected]?Subject=Staff%20Photo%20Updates' target='_top'> [email protected]
    </a> with <b>Staff Photo Updates</b> in the subject."
        $msg.Body += "<p>"
        $msg.Body += "This report runs on Fridays and will only send a message if we have Staff without Photos. For more information please contact your systems administrator."
        $msg.Body += "<p>"
        $msg.Body += $Report | ConvertTo-Html -Head $Style
        $msg.IsBodyHTML = $true
        $smtp.Send($msg)
    Stop-Transcript

    So after researching further and not receiving any more replies I decided to rewrite the script and attempt to use the send-mailmessage function. I have been unable to determine the reason for the original not script not working. We use a very similar script
    to my original code which works to generate a report and e-mail that report as an attachment and it works without any problems.
    After re-writing the script and using the send-mailmessage function I was able to get this report to work as expected. This has now been set up as a scheduled task to run on a server once a week. Here is the final code:
    Start-Transcript -path c:\Scripts\StaffWithoutPhotos.txt
    #Starts Powershell Snap-In
    add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010 -erroraction silentlyContinue
    $mailboxes = $null
    $mailboxes = @(Get-Mailbox -OrganizationalUnit "contoso Staff User Accounts" -ResultSize Unlimited | Where {$_.HasPicture -eq $False})
    Write-Host $mailboxes
    $report = @()
    foreach ($mailbox in $mailboxes)
    $mbObj = New-Object PSObject
        $mbObj | Add-Member -MemberType NoteProperty -Name "Display Name" -Value $mailbox.DisplayName
        $report += $mbObj
    Write-Host "Diagnostic Output"
    Write-Host "Before Mailbox value check"
    Write-Host $report
    Write-Host "After Mailbox Value check"
    if ($mailboxes -ne $null)
        Write-Host $report
        #Send the report generated to the e-mail list specified above
        $style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
        $style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
        $style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
        $style = $style + "TD{border: 1px solid black; padding: 5px; }"
        $style = $style + "</style>"
        $smtpserver = "MAIL.contoso.com"
        $smtpFrom = "[email protected]"
        $smtpTo = "[email protected]
        $messageSubject = "Staff without Photos report"
        $Body = "This report contains the list of users who do not currently have photos."
        $Body += "<p>"
        $Body += "After photos are available for these users please submit a request to the Help Desk to have their accounts updated or send an e-mail to <a href='mailto:[email protected]?Subject=Staff%20Photo%20Updates' target='_top'> [email protected]
    </a> with <b><u>Staff Photo Updates</b></u> in the subject."
        $Body += "<p>"
        $Body += "This report runs on Fridays and will only send a message if we have Staff without Photos. For more information please contact your systems administrator."
        $Body += "<p>"
        $Body += $Report | ConvertTo-Html -Head $Style
        #Send the report
        send-mailmessage -from "$smtpFrom" -to "$smtpTo" -subject "$messageSubject" -body "$Body" -smtpServer "$smtpserver" -BodyAsHtml
    Stop-Transcript

Maybe you are looking for

  • Update to 10.5.3

    I am trying to upgrade from macOS X 10.5.3 to 10.5.8. My computer automatically looks for updates. I tried to update to 10.5.8 and my computer freezes during the initialization. What do I need to change/do?

  • IBooks Author crashes every 30 seconds: h264 encoder?

    I am using iBooks Author 2.1.1 on Mavericks. The program is crashing like every 30 seconds for no apparent reason (specific actions, that is). I cannot see the <edited by host> problem reporter anymore  . This is what it offers all the time stating s

  • Migration from BO 6.5 to BO XI R 3.0

    Please let me know, what are the issues faced while migrating from BO 6.5 to BO XI R 3.0  in case of Universes (ii) Desktop Intelligence Reports (iii) Web Intelligence reports Do you have any document, please share with me? Thanks

  • Should I avoid the Yoga?

    After looking at quite a few laptops, none of them stick out as much as the Yoga. I am in love with the vibrant IPS screen with the 1600x900 resolution display (because 1080p makes text too small and I don't believe in switching DPI). The design is s

  • Failier in loading jar files in oracle 10g

    Hi All, I am not sure if I should post my problem in this forum or Java one.I am trying to use jasper report inside my apex application.The first thing I did was to develop the report example in NetBeans and it worked.Now I try to do the same and com