To answer my own question:
(variables are different, but you get the idea)
$mySeries1 = new-object System.Windows.Forms.DataVisualization.Charting.Series
[void]$mySeries1.Points.Add(14)
[void]$mySeries1.Points.Add(34)
[void]$mySeries1.Points.Add(42)
[void]$mySeries1.Points.Add(18)...
Hi All
I'm a bit of a novice with PS, and have been trying to create a graphic, following the tutorial here.
There a section where he enters x & y values using an array:
# add data to chart
$Cities = @{London=7556900; Berlin=3429900; Madrid=3213271; Rome=2726539;
Paris=2188500}...
Thanks for your help strongm, but I'm struggling. I get an error of "Microsoft VBScript compilation error: Invalid character" when the "isunicode =" line runs.
I made the following script based on your response:
Const ForReading = 1, ForWriting = 2
Const TriStateTrue = -1...
Hi guys
I am opening text files in vbscript, and need to discover if I should use TriStateTrue or TriStateFalse.
e.g.
Set objInputFile = objFSO.OpenTextFile(strFilePath, ForReading, False, TristateTrue)
is there a way to interrogate the file before I open it? If I open in the wrong format...
Thanks for the help - solution turned out to be:
Set objNamespace = GetObject("LDAP:")
Set objOU = objNamespace.OpenDSObject("LDAP://otherforest.com/OU=TheOUToCreateTheUserIn,DC=otherforest,DC=com", strUsername, strPassword, 0)
objOU.Create("user", "CN=Username")
Where 0 is the encryption flag
Hi all,
I've got to create a user account (with vbscript) in a different Forest. I know the account I'm using has the relevant permission in that Forest, but am struggling to create the object.
On the objUser.setinfo line, I get the error:
-2147016651
The server is unwilling to process the...
Hi Guys
i've created a CSV file with a vbscript and the filesystemobject. Now I want to read the content of that file into an array.
Trouble is, when I attempt to read the file using objFile.readline, it's garbage. Always starts with "ÿþF", and nothing else will echo out.
I can manually...
Hi Guys
My Company has joined with another, and we have both got a Win 2003 AD. I want to run a query against their AD via ADO as follows:
set ons=getobject("LDAP:")
set ocontainer=ons.OpenDSObject( _
"LDAP://Company2DC.company2.com/cn=users,dc=company2,dc=com", _
szUsername, _...
Thanks for the answer. In the end, I decided to loop through the rows of the spreadsheet, and construct the array size, then go back to the beginning, Dim the array, then Redim it with the variable, and add the items into the array for a For statement.
Hi all
I'm trying to build a 2 dimensional array from values in a spreadsheet.
I am used to using the redmin preserve array(x) command to add values, but when I try this for a multi-dimentsional array I get an "out of range" error. Can anyone help?
n = 0
intColumn = 1
dim m
Dim...
I need to have a load of similar string variables in my script, with the same name, but incremented with a number. Normally I would do something like:
dim item1, item2, item3, item4, item5, item6
I was hoping that there may be an easier way to refer to these, but am a bit rusty on vbscript...
Looking at the output of hssid, it doesn't look like a Hex string - there are no letters in it. Certainly the value echoed out doesn't match the Hex version of the string displayed via the Exchange 5.5 Admin tool (using Raw mode).
Any thoughts? (thanks for help so far)
Thanks - ossid (in the for/next routine) is not defined anywhere though - I assume you mean basid?
Even so, if I run the code below I get the same error while doing the last line: <null> : catastrophic failure at character 7
basid = oRS.Fields("Assoc-NT-Account")
hssid=""
for i=0 to...
Thanks tsuji,
I'm using the code below, but the line in red crashes with <null> : catastrophic failure at character 7.
Dim basid
Const ADS_SID_RAW = 0
Const ADS_SID_HEXSTRING = 1
Const ADS_SID_SAM = 2
Const ADS_SID_UPN = 3
Const ADS_SID_SDDL = 4
const ADS_SID_WINNT_PATH = 5
const...
I'm trying to audit our Exchange 55 environment as part of a migration (finally) to E2k3.
One of the jobs I'm doing means I want to know what accounts are permissioned against mailboxes, so I'm using an LDAP query that returns the SID of Assoc-NT-Account.
I've got ADsSecurity.dll installed...
dm4ever, thats great - opened up a new world of possibilities there. Will have a good play around.
Some of the scripts I want to run can take an hour to execute, so I want to see the HTML update dynamically. I assume I can find a way to do this in the HTA.
As for the parameters, well, some...
Err, I'm not very aware of what a HTA file is or does, or how and why I would do that?
The modus operandi here is to execute a script, have it output the results in HTML, and place a button on that page which allows the operator to rerun the script using some variables captured during the first...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.