Search found 14450 matches

by jvierra
Thu Mar 05, 2009 1:14 am
Forum: PowerShell
Topic: Create AD Site Link
Replies: 12
Views: 7285

Create AD Site Link

Yes I know...your next question is ... how do I get a site by name?

Stay tuned for the sequel.
by jvierra
Thu Mar 05, 2009 12:51 am
Forum: PowerShell
Topic: Need only the numbers between quotes in string?
Replies: 11
Views: 4703

Need only the numbers between quotes in string?

http://www.regular-expressions.info/ # create regex object with pattern "d+" $reg=[regex]"d+" #return collection of matches in content of $line $m=$reg.Matches($line) #display contents of match 1's value. $m[1].Value "d+" detects one or more occurences of a "decimal" character.
by jvierra
Wed Mar 04, 2009 12:58 pm
Forum: PowerShell
Topic: Get-ItemProperty question
Replies: 3
Views: 1262

Get-ItemProperty question

Actuyally this is what yo uneed

Code: Select all

(Get-ItemProperty -Path HKLM:SYSTEMCurrentControlSetServicesSrv -name ImagePath).ImagePath

Or better

Code: Select all

$valuename="ImagePath"
(Get-ItemProperty -Path HKLM:SYSTEMCurrentControlSetServicesSrv -name $valuename).psbase.Properties[$valuename].Value
by jvierra
Wed Mar 04, 2009 9:03 am
Forum: PowerShell
Topic: Create AD Site Link
Replies: 12
Views: 7285

Create AD Site Link

It might be helpful to note that there is only ONE "Inter-Site-Transports" container per forest. This is the "$forest.sites[0].sitelinks[0]". You are defining associations stored in this container. Her is a way to add site links frm teh SDK. function Add-ADSiteLink(     [System.DirectoryServices.Act...
by jvierra
Wed Mar 04, 2009 7:40 am
Forum: PowerShell
Topic: Create AD Site Link
Replies: 12
Views: 7285

Create AD Site Link

You add the "site" object to the sites collection not the name. You only use the name to create the site.

Why do you not just use Jeff's code. It is correct and works.
by jvierra
Wed Mar 04, 2009 7:22 am
Forum: PowerShell
Topic: Create AD Site Link
Replies: 12
Views: 7285

Create AD Site Link

You are adding "$Sites" which is an array of strings.
You want to create a site object and add it here.
by jvierra
Wed Mar 04, 2009 7:13 am
Forum: VBScript
Topic: dom parser
Replies: 2
Views: 1140

dom parser

Try loading the web page with XMLHttp object. You will have to override error handling if the page is not XML compliant. Most older sites are not.

by jvierra
Wed Mar 04, 2009 7:11 am
Forum: PowerShell
Topic: Need only the numbers between quotes in string?
Replies: 11
Views: 4703

Need only the numbers between quotes in string?

This gets all of your values too.

$file="fuse.html"(gc $file) -match "s.propd=`"`""

by jvierra
Wed Mar 04, 2009 6:35 am
Forum: PowerShell
Topic: Need only the numbers between quotes in string?
Replies: 11
Views: 4703

Need only the numbers between quotes in string?

Are you looking for something like this: $number="x.num=`"1234`""$number=$number.Replace("`"","")$number.SubString($number.IndexOf("=")+1,$number.Length - $number.IndexOf("=") - 1) This etracts a number from a string without regex. Of course you could do the whole thing with reges or with regex grou...
by jvierra
Wed Mar 04, 2009 5:51 am
Forum: Other Scripting Languages
Topic: Select Computers Interface
Replies: 1
Views: 1724

Select Computers Interface

Here is a simple one - OK I lied. It took 7 lines of code. http://www.sapien.com/forums/uploads/2491/select.txt <html> <head> <script language="vbscript">     Sub moveit()             if leftlist.selectedIndex >= 0 Then             Set opt = leftlist.options(leftlist.selectedIndex)             leftl...