Search found 15436 matches

by jvierra
Mon May 04, 2009 5:42 am
Forum: PowerShell
Topic: read email using powershell
Replies: 6
Views: 8466

read email using powershell

Ther eis still CDOEX (CDO for Exchange) which can read any and all mailboxes and retrieve mail items. It can be used to crete add-ins for Exchange htat can manage mail with an eventing interface. See Exchange 2007 SDK/CDOEX. http://msdn.microsoft.com/en-us/library/aa579557.aspx CDOEX is mostly expos...
by jvierra
Sat May 02, 2009 4:38 pm
Forum: PowerShell
Topic: Piping a service value
Replies: 3
Views: 1636

Piping a service value

get-service "Apple Mobile Device" | %{$_.Status -eq "Started"}
by jvierra
Fri May 01, 2009 5:54 am
Forum: PowerShell
Topic: Remote Certifcate Store Query
Replies: 5
Views: 3783

Remote Certifcate Store Query

Net classes to the rescue. function Get-Certs( $computer=$env:computername ){ $ro=[System.Security.Cryptography.X509Certificates.OpenFlags]"ReadOnly" $cu=[System.Security.Cryptography.X509Certificates.StoreLocation]"LocalMachine" $c=new-object System.Security.Cryptography.X509Cer...
by jvierra
Thu Apr 30, 2009 8:46 am
Forum: Other Scripting Languages
Topic: Require Checkbox to be checked
Replies: 9
Views: 9080

Require Checkbox to be checked

Yes - if you need to run your scripts accross all platforms then VBScritp may be a better choice. It is possible to deploy PowerShell through Group Policy so lack of PS is not a big issue. If you have W2K platforms then you are stuck with VBScript. (Of course W2K is obsolete and OUt-of support. I st...
by jvierra
Thu Apr 30, 2009 8:29 am
Forum: Other Scripting Languages
Topic: Require Checkbox to be checked
Replies: 9
Views: 9080

Require Checkbox to be checked

To demonstrate what I am trying to say here is a simple VBS script that loads two CSV files. Set rs1 = GetData( "select * from data1.csv" ) Dumper rs1 Set rs2 = GetData( "select * from data2.csv" ) Dumper rs2 Function Dumper( rs )     With rs         For Each f In .Fields        ...
by jvierra
Thu Apr 30, 2009 5:10 am
Forum: PowerShell
Topic: Problem with set ACL script
Replies: 9
Views: 14930

Problem with set ACL script

This is shorter, easier an dmore reliable. # get ACl $di=[System.IO.DirectoryInfo]$FileDir$AccessControl=$di.GetAccessControl() ... # set acl $di.SetAccessControl($AccessControl) This mkae only one roundtrip. YOur method makes two and needs to translate the name. It may not always work.
by jvierra
Wed Apr 29, 2009 5:21 am
Forum: PowerShell
Topic: Problem with set ACL script
Replies: 9
Views: 14930

Problem with set ACL script

Solution A: $di=[System.IO.DirectoryInfo]"d:downloadtest[test]" $AccessControl = $di,GetAccessControl() $AccessControl.Add($AccessRule) $di.SetAccessControl($AccessControl) This works for troublesome name strings. The script can be modiffed to replace both get-acl and set-acl. Method work ...
by jvierra
Wed Apr 29, 2009 3:43 am
Forum: VBScript
Topic: Find line in text file and insert txt above it
Replies: 12
Views: 8047

Find line in text file and insert txt above it

That is XML and the COM objects do not provide a formatter. PowerShell and NET classes have the missing formatter to "pretty print" the XML to the file. Don't worry about looks. The XML is correct and will work correctly. Using teh COM object to edit will protect the XML from being hosed b...
by jvierra
Tue Apr 28, 2009 5:13 am
Forum: VBScript
Topic: Find line in text file and insert txt above it
Replies: 12
Views: 8047

Find line in text file and insert txt above it

Set xmlDoc = CreateObject("Msxml2.DOMDocument") sFile = "c:testconfig.xml" xmlDoc.preserveWhiteSpace = True xmlDoc.load( sFile ) '<runtime></runtime> append_node xmlDoc, "/configuration", "runtime", "" '<generatePublisherEvidence enabled="false...
by jvierra
Tue Apr 28, 2009 4:46 am
Forum: VBScript
Topic: Find line in text file and insert txt above it
Replies: 12
Views: 8047

Find line in text file and insert txt above it

Your root XPath is "Configuration" as I pointed out.