Search found 133 matches

by Domtar
Fri Feb 10, 2023 6:10 am
Forum: PowerShell
Topic: ActiveDirectory module installation
Replies: 6
Views: 2819

Re: ActiveDirectory module installation

i know that RSAT is not for users, which is why i'm trying to install the module. but we need to run scripts on our computers that grab some info from AD and LDAP commands are mostly useless for what we need. here's an example to illustrate what we need: we have several single user computers that ar...
by Domtar
Thu Feb 09, 2023 10:26 am
Forum: PowerShell
Topic: ActiveDirectory module installation
Replies: 6
Views: 2819

ActiveDirectory module installation

hi all,

someone has a script to install this ActiveDirectory module without installing RSAT? google is no help here.

thanks!
by Domtar
Fri Jan 20, 2023 3:55 am
Forum: PowerShell
Topic: need help with regex
Replies: 3
Views: 1502

Re: need help with regex

good morning,

i cannot check if english or french, like i said i'd like to use a regex because we will add languages in the future and i do not wish to re-visit this code to add spanish or german or whateveer is added.

not even sure how many languages there will be at the end.
by Domtar
Thu Jan 19, 2023 8:47 am
Forum: PowerShell
Topic: need help with regex
Replies: 3
Views: 1502

need help with regex

hi, I have a list of languages detected from SCCM and I would like to get only the language name. My SCCM query returns this array: Autopilot - English Devices Autopilot - French Devices I would like to get only English & French from that array. i can easily use a regex to extract one language f...
by Domtar
Thu Jan 12, 2023 8:03 am
Forum: PowerShell
Topic: test to learn about jobs
Replies: 4
Views: 1162

Re: test to learn about jobs

OK this seems to be working and do what i need;

Code: Select all

$pcname = 'somepc'
$jobName = "$($pcname)bios"
$sb = {
	Get-WmiObject -Class Win32_BIOS 
}

Invoke-Command -ScriptBlock $sb -ComputerName $pcname -AsJob -JobName $jobName

by Domtar
Thu Jan 12, 2023 7:49 am
Forum: PowerShell
Topic: test to learn about jobs
Replies: 4
Views: 1162

Re: test to learn about jobs

This is because in the scope of the scriptblock, your variable does not exist. The script block runs in an independent scope where no variables in the local/calling scope are available. You can pass it with the parameter ArgumentList or use the $using: scope modifier to access local variables. sorr...
by Domtar
Thu Jan 12, 2023 7:12 am
Forum: PowerShell
Topic: test to learn about jobs
Replies: 4
Views: 1162

Re: test to learn about jobs

this doesn't work either, same error.

Code: Select all

$pcname = 'somepc'
$id = (Start-Job -ScriptBlock {
		Get-WmiObject -ComputerName $pcname -Class Win32_BIOS | Select-Object *
	}
).Id
$job = Get-Job -Id $id
Receive-Job -Name $job.Name -Keep 
by Domtar
Thu Jan 12, 2023 5:57 am
Forum: PowerShell
Topic: test to learn about jobs
Replies: 4
Views: 1162

test to learn about jobs

hi all, could someone please explain to me why this works: $computername = 'compname' Start-Job -ScriptBlock { Get-WmiObject -ComputerName 'compname' -Class Win32_BIOS | Select-Object * } -Name "$($computername)bios" receive-job -name "$($computername)bios" -keep but this does no...
by Domtar
Thu Dec 22, 2022 5:22 am
Forum: PowerShell GUIs
Topic: issue with get-variable
Replies: 5
Views: 1638

Re: issue with get-variable

yeah it makes sense now. I'll give this a try.

thanks!
by Domtar
Thu Dec 22, 2022 3:44 am
Forum: PowerShell GUIs
Topic: issue with get-variable
Replies: 5
Views: 1638

Re: issue with get-variable

you missed the point. i can remove the tab. it's the variable that i can't remove. the variable exists only if a connection to a computer was done before. get-variable -name x | remove-variable this one gives me an error even though i can see the variable if i pipe it to the log status bar. pseudo-c...