MSX - post 'Start Job' instructions to specific target servers
I have an MSX server with about 150 targets. I'm trying to post download instructions for specific targets (not all targets) to 'Start Job' for a given job. According to http://technet.microsoft.com/en-us/library/ms178327%28v=sql.110%29.aspx,
I can target specific servers with instructions. Instruction types defect, set polling interval, and synchronize clocks all work when specific targets are selected. However, start job does not work for me. My test is as follows:
Instruction Type: Start Job
Job name: Test Database Mail
Recipients: These target servers. I select one or more from the list of 150 targets.
When I click OK, I get a warning that 'Job is already in process.' for each selected target. The job is never started and yet the job is not actually in progress. Am I missing a setting somewhere? Is this a bug? I can't find anything
online regarding other people having this issue.
My MSX server is running SQL 2012 sp1 ENT. My targets range from 2005 sp1 up to 2012 sp1.
Ryan
Hi PHC_DBA,
According to your description, I do a test in my environment, it indeed show the warning of “Job is already in progress.” . Personally, I recommend you that submit a feedback to Microsoft such issues at this link
https://connect.microsoft.com/SQLServer/Feedback.
This connect site will serve as a connecting point between you and Microsoft, and ultimately the large community for you and Microsoft to interact with. Your feedback enables Microsoft to offer the best software and deliver
superior services, meanwhile you can learn more about and contribute to the exciting projects on Microsoft Connect.
In addition, one MSX server can control multiple TSX servers. There is no explicit limit defined in the system; however, for practical purposes and to reduce extra load on the master server due to frequent polling connections, it is recommended to
keep the number of TSX servers under 100. For more information, see:http://www.yaldex.com/sql_server_tutorial_3/ch08lev1sec5.html
Thanks,
Sofiya Li
Sofiya Li
TechNet Community Support
Similar Messages
-
Gurus,
When i am importing the workbench request from dev to qty.
I am getting error : Program terminated (job: RDDEXECL, no.: 22321300).
Transformation contains only Endroutine.
Job log:
Job started
Step 001 started (program RDDEXECL, variant , user ID DDIC)
All DB buffers of application server xxxxxx were synchronized
The internal session was terminated with the runtime error UNCAUGHT_EXCEPTION (see ST2
Job cancelled.
When i see the dump it is througing errror at the method of following class.
CL_RSO_TLOGO_PERSISTENCY-CHECK_INITIALIZED
Could you please help. Thanks in advance.
AshokHi Ashok,
In QA use program "RSTRAN_ROUT_RSFO_CHECK" to check and remove any inconsistencies for the transformations. After that again transport those transformations in new TR and import in QA.
Also you have to search "Transport of Transformation failed with RC= 12 and job: RDDEXECL canceled in Target system" by Dinesh Tiwari.
Check the reply of Fun Sébastien in http://scn.sap.com/message/13795238#13795238. -
Error occured while posting the job schedule for JDBCAdapter
Hi Experts,
In Application Log in Path: "/usr/sap/<SID>/DVExxxx/j2ee/cluster/server1/log", I see the error:
#/Applications/ExchangeInfrastructure/AdapterFramework/Services/Util
##com.sap.aii.af.service.scheduler.SchedulerManagerImpl.postJobScheduleOthers(String, int)
#J2EE_GUEST#0##n/a##f7956e1f6b4711e0b851001e0b5d3ac8#SAPEngine_Application_Thread[impl:3]_23##0#0
#Error#1#com.sap.aii.af.service.scheduler.SchedulerManagerImpl#Plain
###error occured while posting the job schedule for JDBCAdapter_9f0584b1bcb33b94b67ada456233bcb8 with 2#
Frequently are created Lock's and I need remove them in Visual Admin.
Any idea about this error?
Tks in advance.Hi,
After applying the SP 23 Patch Level 08, LOCK JDBC problems stopped.
But now when a network error or database error, the JDBC Sender Communication channels that were open to connection, are blocked.
Even following the instructions in [SAP Note 1083488 - XI FTP_JDBC sender channel stop polling indefinitely (04_04S)|https://websmp230.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1083488] the problem continues.
I've already set the parameter "taskTimeout" and selected the option "Disconnect from Database After Each Message Processing" but not resolved.
Any ideas?
Thanks in advance. -
Hi ,
Any one please help me on why the global navigation links are visible to all group users even after applying a specific target audience group to the link. I Checked , User profile service and User profile synchronizing services
and they are running fine. Test environment is running fine even both the services are not running. Please let me know is any relation should be there between target audience and User profile services?
I am wondering that the Target Audience is not working in global navigation suddenly in production server and the same is working in test server.
Thanks & Regards,
NareshRaju YV,
Infosys.Hi NareshRaju,
Did you add SharePoint Groups to Target Audience ? if yes please refer http://social.technet.microsoft.com/Forums/sharepoint/en-US/7862f182-c6a2-4d2e-9025-b11514575ac3/audience-targeting-for-navigation-link-issue?forum=sharepointgenerallegacy and
you will get solution
Let us now if this helps, thanks
Regards,
Pratik Vyas | SharePoint Consultant |
http://sharepointpratik.blogspot.com
Posting is provided AS IS with no warranties, and confers no rights
Please remember to click Mark As Answer if a post solves your problem or
Vote As Helpful if it was useful. -
Required Post Upgrade Jobs: Missing jobs and failures
Folks,
In reviewing "Required Post Upgrade Jobs", I found that "Compile Non-Compiled Flexfields" failed. The job was submitted by APPSMGR and immediately started since the Request Process queues were not initially deactivated as reccomended in doc 399362.1. I'm afraid I don't know the password for APPSMGR. Is there a way for me to restart this job so that any successors release?
Only a handful of the required jobs show to have been submitted and run. Would required jobs that have not run and do not appear in the queue need to be manually submitted?
Thanks for any help.All of my post upgrade processes completed without error except the flexfield compile of AR_ADJUSTMENTS_ALL_DFV. It will not compile from within the forms either:
Oracle error 911: ORA-00911: invalid character
ORA-06512: at "SYSTEM.AD_DDL", line 165
ORA-06512: at line 1 has been detected in afuddl() [3_xdd].
do_ddl(APPLSYS, AR, 2, $statement$, AR_ADJUSTMENTS_ALL_DFV): private_do_ddl(APPS, APPLSYS, AR, 2, $statement$, AR_ADJUSTMENTS_ALL_DFV): do_cd_view(1, APPS, 2, AR_ADJUSTMENTS_ALL_DFV, $statement$): : do_apps_ddl(APPS, $statement$): : substr($statement$,1,255)='CREATE OR REPLACE VIEW AR_ADJUSTMENTS_ALL_DFV
(ROW_ID, "CONTEXT_VALUE", AdjustmentStatus,
CONCATENATED_SEGMENTS)
AS SELECT ROWID, ATTRIBUTE_CATEGORY, ATTRIBUTE4,
ATTRIBUTE4
FROM AR_ADJUSTMENTS_ALL'
View Name: AR_ADJUSTMENTS_ALL_DFV
I am going to apply 5484000 Oracle E-Business Suite 12.0.2 Release Update Pack (RUP2) tonight and see if it makes any difference. -
Start-job with datetime arguments
Hi,
It is working (of course), I get all objects which are newer then $timeFrom:
$timeFrom = "2014-03-25 9:00"
Get-ChildItem c:\temp | ?{$_.CreationTime -gt $timeFrom}
But is not working:
$timeFrom = "2014-03-25 9:00"
Start-Job -ScriptBlock {Get-ChildItem c:\temp | ?{$_.CreationTime -gt $args[0]}} -ArgumentList @($timeFrom)
I get all objects, but if I replace -gt to -lt the list will be empty. Teherefore any kind of compare working, but I can't understand how...
Anybody can help me?When you're using variables defined outside of the scriptblock you have to pass them into the scriptblock. I prefer to keep them all the same just because it's easier to understand for me. Yours probably would have worked if you'd included the
param part:
Start-Job -ScriptBlock {param($args)Get-ChildItem c:\temp | ?{$_.CreationTime -gt $args[0]}} -ArgumentList
@($timeFrom)
but I'm not sure whether or not using $args works at all in this context. It probably does, but without param it definitely wouldn't.
I hope this post has helped! -
Starting SAPGUi (windows) in specific transaction.
Hello SDNers,
I've found some posts similar to my question but not one that actually answer the question, what I would like to do is to activate SAPGUI (windows version) from a Java program, get it to a specific transaction and then let the user take it from there.
I am using sapgui 6.40 and windows server and implemented SSO.
I tried to implement it using SAPJco but only managed to open the saplogon window and not to present a specific transaction, could anyone provide me with a code sample that open SAPgui window in a specific transaction?
Thanks,
Uri.didn't manage to start SAPGUI in a specific transaction using SAPJco so i gave up and started the transaction using os command (using sapshcut) for those who are interesed there's a note that describe all the sapshcut parameters (note# 103019)
-
PowerShell - Start-Job - Synchronised Array list
Hi all,
I am trying to write a script using start-job against a list of machines. The script is to query a target machine event log using get-winevent cmdlet. I supply the whole code that queries the eventlog in a scriptblock. In order to capture the output (one
psobject for each of the scriptblock jobs) I am trying to use a synchronised arraylist. I do not know the full details of how to use the synchronised arraylist but I have put together the below script (by referring to some of the online articles). But the
script does not work as intended. The individual scriptblocks do not seem to be referring to the global arraylist variable while appending the results.
Would any of you be able to shed any light on it?
Please note, the script without the PowerShell Jobs works fine(that is linear execution which is really time-consuming). Also, even with using psJobs, the script works when I try to dump the result of each job into a csv from within the job itself. But I
want to avoid this situation because due to the asynchronous execution there might be contention for the csv by more than one jobs at the same time. Hence I want to use the synchronised array list.
$InputCSV = "$(Split-Path $SCRIPT:MyInvocation.MyCommand.Path -parent)\backupexec.csv"
$OutputCSV = "$(Split-Path $SCRIPT:MyInvocation.MyCommand.Path -parent)\Reports\BackupExec_Output_$(Get-Date -format "ddMMyyyy")_$((Get-Date).DayOfWeek).csv"
$OutputArray = [System.Collections.ArrayList]::Synchronized((New-Object System.Collections.ArrayList))
$counter=1
$jobs=@{};
$jobcounter=0;
Import-CSV $InputCSV | ForEach {
$Comp_Name=$_.ServerName;
$Counter+=1;
$Scriptblock={
Try {
$IsthereAnyResult= @()
$IsthereAnyResult= Get-WinEvent -ComputerName $Using:Comp_Name -ErrorAction SilentlyContinue -FilterHashTable @{LogName='application';ProviderName='Backup Exec';ID=57755; StartTime=(Get-Date).AddDays(-1)}
$props = @{
"Server Name" = ($event.MachineName -split '\.')[0];
"Event ID" = $event.ID;
"Time Logged" = $event.TimeCreated;
"Backup Result" = Switch ($event.ID) { '57755' {"Success - Skipped"}
'34113' {"Failed"}
'34112' {"Success"} };
"Message" = $event.Properties[0].value -replace '\n' -replace '\r';
$OutputArray += New-Object PSObject -Property $props
} #end try get-winevent
Catch { } #end Catch
} #end scriptblock
$jobs[$jobcounter]= Start-job -name $("Job_$jobcounter") -ScriptBlock $Scriptblock
$jobcounter+=1;
While((Get-Job -State 'Running').Count -ge 10) {
Start-Sleep -Milliseconds 10
} # end main foreach
Get-Job | Wait-Job
$OutputArray | Select-Object "Server Name","Event ID","Time Logged","Backup Result","Message" | Export-CSV -force -Path $OutputCSV -NoTypeInformation -AppendHow about this?
I use wmi win32_ntlogevent which i prefer .. Timeservice is just for example ...
Change the scriptblock to your needs and report the result :]
Param ([int]$BatchSize=2)
#list of servers
[array]$source = (get-adcomputer -filter {name -like "server*"}) |select -expandproperty dnshostname
$blok = {
get-wmiobject Win32_NTLogEvent -Filter "(Logfile='System') and (SourceName = 'Microsoft-Windows-Time-Service')" |select -first 10 |select __server,@{n="EventCode";e={switch($_.EventCode){37{"37 - Receiving"}35{"35 - Synchronizing"}129{"129 - NTP Fail"}default{"Other EventCode"}}}},@{n="Date";e={$_.ConvertToDateTime($_.TimeGenerated)}},message
$elapsedTime = [system.diagnostics.stopwatch]::StartNew()
$result = @()
$itemCount = 0
## checking running jobs
if (get-job|? {$_.name -like "Script*"}){
write-host "ERROR: There are pending background jobs in this session:" -back red -fore white
get-job |? {$_.name -like "Script*"} | out-host
write-host "REQUIRED ACTION: Remove the jobs and restart this script" -back black -fore yellow
$yn = read-host "Automatically remove jobs now?"
if ($yn -eq "y"){
get-job|? {$_.name -like "Script*"}|% {remove-job $_}
write-host "jobs have been removed; please restart the script" -back black -fore green
exit
$i = 0
$itemCount = $source.count
Write-Host "Script will run against $itemcount servers!"
## Script start time mark
write-host "Script started at $(get-date -uFormat "%Y/%m/%d %H:%M:%S")".padright(60) -back darkgreen -fore white
write-host " (contains $itemCount unique entries)" -back black -fore green
$activeJobCount = 0
$totalJobCount = 0
write-host "Submitting background jobs..." -back black -fore yellow
for ($i=0; $i -lt $itemCount;$i += $batchSize){
$activeJobCount += 1; $totalJobCount += 1; $HostList = @()
$HostList += $source |select -skip $i -first $batchsize
$j = invoke-command -computername $Hostlist -scriptblock $blok -asjob
$j.name = "Script`:$totalJobCount`:$($i+1)`:$($getHostList.count)"
write-host "+" -back black -fore cyan -nonewline
write-host "`n$totaljobCount jobs submitted, checking for completed jobs..." -back black -fore yellow
while (get-job |? {$_.name -like "Script*"}){
foreach ($j in get-job | ? {$_.name -like "Script*"}){
$temp = @()
if ($j.state -eq "completed"){
$temp = @()
$temp += receive-job $j
$result += $temp
remove-job $j
$ActiveJobCount -= 1
write-host "-" -back black -fore cyan -nonewline
elseif ($j.state -eq "failed"){
$temp = $j.name.split(":")
if ($temp[1] -eq "R"){
$temp = @()
$temp += receive-job $j
$result += $temp
remove-job $j
$ActiveJobCount -= 1
write-host "-" -back black -fore cyan -nonewline
else{
write-host "`nFailure detected in job: $($j.name)" -back black -fore red
$temp = @()
$temp += receive-job $j
$result += $temp
remove-job $j
$ActiveJobCount -= 1
if ($result.count -lt $itemCount){
sleep 3
write-host " "
write-host "Script finished at $(get-date -uFormat "%Y/%m/%d %H:%M:%S")".padright(60) -back darkgreen -fore white
write-host (" Elapsed Time : {0}" -f $($ElapsedTime.Elapsed.ToString())) -back black -fore green
$result |select __server,eventcode,Date,message |ft -auto
write-host " Script completed all requested operations at $(get-date -uFormat "%Y/%m/%d %H:%M:%S")".padright(60) -back darkgreen -fore white
write-host (" Elapsed Time : {0}" -f $($ElapsedTime.Elapsed.ToString())) -back black -fore green -
Loop thru Status table and start job
I have a STATUS Tbl, that has a field called CompleteDate.Only if the CompleteDate field has TODAYS Today, then I want to proceed with my ssis task, to
insert data in some tables. If the CompleteDate Is not yet todays date, then I want to check the status table again every 10 minutes, until the CompleteDate
changes to TODAYS Date. THEN Start my insert process after that.
select
Max(convert(varchar(10),
CompleteDate, 121))
from Db.dbo.StatusTable
I used the WAITFOR DELAY But that doesnot help.
Any idea. here is the code I am using BUT THAT Comes out of the LOOP and does not keep rechecking the satus table
declare
@MaxDt varchar(10)
set @MaxDt=(select
max(convert(varchar(10),
CompleteDate, 121))
from DB.dbo.StatusTable)
--select @MaxDt
DECLARE
@flg BIT
SET
@flg = 0
BEGIN
IF
EXISTS
SELECT
CASE
WHEN @MaxDt
>=convert(varchar(10),
getdate(), 121)
THEN 1
ELSE 0
END
SET @flg
= 1
WAITFOR
END
set
DELAY
'00:10:00'>If the CompleteDateIs not yet todays date, then I want to check the status table again every 10 minutes,
It is safer to setup the stored procedure as a scheduled job without the WAITFOR.
BOL: " Creating Jobs
A job is a specified series of operations performed sequentially by SQL Server Agent. A job can perform a wide range of activities, including running Transact-SQL scripts, command prompt applications, Microsoft ActiveX scripts, Integration Services packages,
Analysis Services commands and queries, or Replication tasks. Jobs can run repetitive or schedulable tasks, and they can automatically notify users of job status by generating alerts, thereby greatly simplifying SQL Server administration.
To create a job, a user must be a member of one of the SQL Server Agent fixed database roles or the sysadmin fixed server role. A job can be edited only by its owner or members of the sysadmin role. For more information about the SQL Server Agent fixed database
roles, see SQL Server Agent Fixed Database Roles.
Jobs can be written to run on the local instance of SQL Server or on multiple instances across an enterprise. To run jobs on multiple servers, you must set up at least one master server and one or more target servers. For more information about master and
target servers, see Automating Administration Across an Enterprise"
LINK:
http://technet.microsoft.com/en-us/library/ms186273(v=sql.105).aspx
Kalman Toth Database & OLAP Architect
SELECT Video Tutorials 4 Hours
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
Hello folks,
I am trying to setup a simple Start-Job command. This basic command works for me and copies the file correctly.
Start-Job -Scriptblock {Copy-Item -Path \\192.168.32.25\share\butterfly.jpg -Destination c:\test\ -Recurse -Verbose}
However, it does not work when I try using variable like this.
$source = "\\192.168.32.25\share\butterfly.jpg"
$target = "c:\test\"
Start-Job -Scriptblock {Copy-Item -Path $source -Destination $target -Recurse -Verbose}
Anyone have suggestions for getting this to work with variables?
Thanks,
romatloHi,
Here's some information:
http://powershell.org/wp/forums/topic/passing-parameter-to-start-job/
https://social.technet.microsoft.com/Forums/scriptcenter/en-US/ff644fca-1b25-4c8a-9a8a-ce90eb024389/in-powershell-how-do-i-pass-startjob-arguments-to-a-script-using-param-style-arguments?forum=ITCG
Basically, look at using -ArgumentList:
http://ss64.com/ps/start-job.html
Don't retire TechNet! -
(Don't give up yet - 13,225+ strong and growing) -
On my Mac Pro how can I get voiceover to start reading at a specific point in a document, and then continue on to the next paragraph and so on? Thank you. Ed
Welcome to the Apple family!!!!
How can I cause the VO cursor(box) show-up/start?
Press Control-Option and F5. The F5 key is located on the top row of keys 6th key over. This is a toggling "Keyboard Shortcut" for turning VoiceOver on and off.
How can I move the VO cursor to various sentences or paragraphs of an article and have it start reading ... and perhaps even continue reading on to the next paragraph(s) ... even to the end of the article?
How to read a website with VoiceOver
Step 1: Go to the Website
A quick keyboard shortcut is Command-L. This will jump you up to the address bar. Start typing where you want to go. i.e "www.thewebsite.com"
Step 2: Working with Webpage
VoiceOver will automatically start reading the website. You can pause the speech by hitting the 'Control Button'.
If VoiceOver does not being reading the webpage, then you might have to "Interact" with it. If VoiceOver say "HTML Content" then press Control-Option-Space-Down Arrow to interact with the webpage.
Use Control-Option-Right Arrow to move throught the website. This will speak "EVERYTHING" on the page.
Most website that I've found have their articles labeled as 'Heading'. You can jump from heading to heading, by pressing Control-Option-Shift-H.
If you'd like an itemized alphabetical listing of the site, press Control-Option-I
Press Control-Option-Space on the link or article you want to view.
Step 3. Reading from Top to Bottom
Once you found and clicked on the the article/link, use the same 'Heading' command, Control-Option-Shift-H to find the title.
After finding the title, press Control-Option-A will start reading from the title on.
Note: If there are any other items (ads, pictures, etc) it will read those too.
Tip: You might be able to activate a feature called the 'Reader'. The Reader isolates the article and elimanates the ads The keyboard command is Shift-Command-R. You can also find it in the Menu Bar (Command-Option-M) under the word 'View' then 'Show Reader'.
I am using a MACPro with OSX, probably Mavericks 10.9 (where would I look to see if that is the correct information?)
You can find this information under the 'Apple menu' in the Menu Bar. To access the Menu Bar, press Control-Option-M.
Go to Apple Menu > About This Mac. This will open up another window. Use Control-Option-Right Arrow until you hear 'Version'. If you purchased it brand new from Apple within the last six month, more than likely you have Mavericks.
Recommanded Articles.
AppleVis- Commonly used Keyboard Commands
Chapter 2: Learning VoiceOver Basics
Chapter 6: Browsing the internet
Apple Accessibility Resource Page
The 'Commands Help' Voiceover Menu. Control-Option-H-H. (hit H twice) is my best friend. It's a searchable VoiceOver Menu with most of the VoiceOver command. Example: You are looking for the 'Read Current Paragraph' keyboard command. Press Control-Option-H-H and then type Paragraph. It will then bring up all the commands with the word paragraph. I believe there are three.
As from the Trackpad Commands, I've copied and pasted below from Appendix A: Commands and Gestures
VoiceOver standard gestures
If you’re using a Multi-Touch trackpad, you can use VoiceOver gestures. VoiceOver provides a set of standard gestures for navigating and interacting with items on the screen. You can’t modify this set of gestures.
NOTE:Gestures that don’t mention a specific number of fingers are single-finger gestures.
General
Enable the Trackpad Commander and VoiceOver gestures
VO-Two-finger rotate clockwise
Disable the Trackpad Commander and VoiceOver gestures
VO-Two-finger rotate counterclockwise
Turn the screen curtain on or off
Three-finger triple-tap
Mute or unmute VoiceOver
Three-finger double-tap
Navigation
Force the VoiceOver cursor into a horizontal or vertical line when you drag a finger across the trackpad
Hold down the Shift key and drag a finger horizontally or vertically
Move the VoiceOver cursor to the next item
Flick right
Move the VoiceOver cursor to the previous item
Flick left
Move content or the scroll bar (depending on the Trackpad Commander setting)
Three-finger flick in any direction
Go to the Dock
This gesture moves the VoiceOver cursor to the Dock wherever it’s positioned on the screen
Two-finger double-tap near the bottom of the trackpad
Go to the menu bar
Two-finger double-tap near the top of the trackpad
Open the Application Chooser
Two-finger double-tap on the left side of the trackpad
Open the Window Chooser
Two-finger double-tap on the right side of the trackpad
Jump to another area of the current application
Press Control while touching a finger on the trackpad
Interaction
Speak the item in the VoiceOver cursor or, if there isn’t an item, play a sound effect to indicate a blank area
Touch (includes tap or dragging)
Select an item
Double-tap anywhere on the trackpad
You can also split-tap (touch one finger and then tap with a second finger on the trackpad)
Start interacting with the item in the VoiceOver cursor
Two-finger flick right
Stop interacting with the item in the VoiceOver cursor
Two-finger flick left
Scroll one page up or down
Three-finger flick up or down
Escape (close a menu without making a selection)
Two-finger scrub back and forth
Increase or decrease the value of a slider, splitter, stepper, or other control
Flick up (increase) or flick down (decrease)
Text
Read the current page, starting at the top
Two-finger flick up
Read from the VoiceOver cursor to the end of the current page
Two-finger flick down
Pause or resume speaking
Two-finger tap
Describe what’s in the VoiceOver cursor
Three-finger tap
Change how VoiceOver reads text (by word, line, sentence, or paragraph)
Press the Command key while touching a finger on the trackpad
Rotor
Change the rotor settings
Two-finger rotate
Move to the previous item based on the rotor setting
Flick up
Move to the next item based on the rotor setting
Flick down
To customize other gestures by assigning VoiceOver commands to them, use the Trackpad Commander.
Assigning VoiceOver commands to gestures
If you need a reminder about what a gesture does, press VO-K to start keyboard help, and then use the gesture on the trackpad and listen to the description.
Learning about keys, keyboard shortcuts, and gestures
Sorry lots of information. Enjoy. You -
PowerShell using start job to run multiple code blocks at the same time
I will be working with many 1000’s of names in a list preforming multiple function on each name for test labs.
I notice when it is running the functions on each name I am using almost no CPU or memory. That led me to research can I run multiple threads at once in a PowerShell program. That lead me to articles suggesting start-job would do just want I am looking
for.
As a test I put this together. It is a simple action as an exercise to see if this is indeed the best approach. However it appears to me as if it is still only running the actions on one name at a time.
Is there a way to run multiple blocks of code at once?
Thanks
Start-Job {
$csv1 = (Import-Csv "C:\Copy AD to test Lab\data\Usergroups1.csv").username
foreach ($name1 in $csv1) { Write-Output "Job1 $name1"}
Start-Job {
$csv2 = (Import-Csv "C:\Copy AD to test Lab\data\Usergroups2.csv").username
foreach ($name2 in $csv2) { Write-Output " Job2 $name2"}
Get-Job | Receive-Job
LishronYou say your testing shows that you are using very little cpu or memory in processing each name, which suggests that processing a single name is a relatively trivial task.
You need to understand that using a background job is going to spin up another instance of powershell, and if you're going to do that per name what used to require a relatively insignificant amount of memory is going to take around 60 MB.
Background jobs are not really well suited for multi-threading short-running, trivial tasks. The overhead of setting up and tearing down the job session can be more than the task itself.
Background jobs are good for long-running tasks. For multi-threading short, trivial tasks runspaces or a workflow would probably be a better choice.
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " " -
How can i start Terminal in a specific folder
how can i start Terminal in a specific folder
From the menu bar, select
▹ System Preferences... ▹ Keyboard ▹ Keyboard Shortcuts ▹ Services ▹ New Terminal at Folder: On
Right-click or control-click a folder in the Finder and select that item from the contextual menu. -
Hello.
I began with the DPS. Is it possible to publish a magazine for a limited, specific target group? For example, in one department of a large company?
Or to the responsible for various services? If so, how should I do? Thank you for your help.Short answer is yes.
Click the request for consultation link in Digital Publishing Suite Help | DPS pricing options to receive a price estimate for the DPS license your project. -
Is it possible to pre-set Logic Express to start recording at a specifi time, in my absence?
I am using a new MacBook Pro with solid state drive.As far as I know Logic is not able to timer record. But Audacity can and it's a free program:
http://audacity.sourceforge.net/download/features-1.3-k.php
Maybe you are looking for
-
IOS 7, iTunes Match, and downloads to Music -- beware of your first use
I'll explain the situation in a moment. My question for the community is if someone saw a way to avoid this from happening. I just encountered a perfect storm when I upgraded to ios 7. So far it has cost me $230 in excess data charges. I am an iTunes
-
Where is the running JAVA file is located
Hey, lets say my java file would be in C:\package1\whereIam.java if I run this program, how can I ask (command ?), in which directory the running java file is located. i.e. I would like to get C:\package1 Aykut
-
Firefox 4 multi user environment in linux: How to set global settings?
<blockquote>Locking duplicate thread.<br> Please continue here: [/questions/826921]</blockquote><br> Hi, We used to be able to change settings in all.js file in FF 3.x.x platform, for changing settings like, proxy, authentication, etc. We installed F
-
Hi There, I have a report the users want to run in background, the report is an ALV type abap and we use the FM REUSE_ALV_GRID_DISPLAY to display the data on screen. I am aware of the conversion from GRID to LIST from other posts. However, my proble
-
Im trying to sync the music from my phone to my itunes if i right click on my phone under deviced and click sync will it transfer all of my music from my phone?