|
Use MCMS API to show current database
Hello
Is it possible to use the MCMS API to show the current database that
the CMS Context is pointing at?
I sometimes point MCMS at a different SQL databse using the DCA, and I
would like to be able to programmatically see what database it is
pointed at. Currently I have to fire up the DCA, and go forward in the
wizard to the screen where you select a differnent database. This
takes so...
|
1 |
21.06.2007 08:37:04 |
|
Get-Service : Default status
figured out to to get the status and a bunch of other stuff.. but i cant
figure out what the default status is. basically im looking for a way to
list only services that are not running that should be running. can do most
of it, just cant figure out what the state should be (looking for startup
type Automatic)
Thanks
Justin
...
|
5 |
21.06.2007 05:04:00 |
|
Script Parameters
Is there a method to create script command line parameters similar to cmdlet
parameters that are not positional? I would like to create a script
containing options/parameters that require arguments.
Example:
scriptname -Filter *.ps1 -path ./
parses the same as
scriptname -path ./ -Filter *.ps1
...
|
3 |
21.06.2007 04:20:00 |
|
Newbie Question: Sample Scripts
Hi. I'm totally new to PowerShell. Saw it for the first time at
Tech*Ed 2007 in Orlando a couple weeks ago. Heard a great
presentation by Don Jones and picked up his book, "Windows Powershell
TFM" and it's been helpful. I have no C#, no VB scripting or Perl
scripting, no code development or programming experience of any kind.
I'm a systems administrator with years of Windows shell scripti...
|
4 |
21.06.2007 03:20:05 |
|
Remote registry question
Hi
I must to prepare all my servers to winter clock (yes, I'm working on
it from now...)
While I can read remote reg and verify the value
$server = "office1"
$type = [Microsoft.Win32.RegistryHive]::LocalMachine
$regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($type,
$server)
$regKey = $regKey.OpenSubKey(SYSTEM\CurrentControlSet\Control
\TimeZoneInformation)
$arrName =...
|
6 |
21.06.2007 02:17:39 |
|
Using Cmdlet Help Editor?
If you're using Cmdlet Help Editor
(http://blogs.msdn.com/powershell/archive/2007/05/08/cmdlet-help-editor-tool.aspx), please reply here and let us know how it's working for you.
Any comments or questions?
--
June Blender [MSFT]
Windows PowerShell Documentation
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
...
|
3 |
21.06.2007 02:06:45 |
|
InvokeMethod Problem
Greetings. I'm new to powershell and I am trying to get a script working
that I picked up in a blog. I have a windows service that I developed and I
am trying to automate the deployment of it to a development server through
NANT.
After some research I picked up the script here:
http://preetsangha.spaces.live.com/blog/
My problem is that when that script runs I get the following err...
|
2 |
20.06.2007 21:54:22 |
|
Difficult with regex and multiple things on a line
I have a file with a line like the following:
AND spraddr.spraddr_from_date = (SELECT MIN(s1.spraddr_from_date)
This is from a SQL script for those that are interested. I want to
parse out each occurrence of spraddr_from _date (in fact, I want to
look for any field that follows the '.' and is of the form abc_abc --
that is, there is at least one underscore in the field name). I do
no...
|
11 |
20.06.2007 17:34:11 |
|
params containing blanks
This is an example of a cmd script I need to run:
powershell .\startSybaseSvcs "FglClient_ch-xxxx-01" "SYSAM" "Sybase
SQLServer _ CHXXXX01" "Sybase BCKServer _ CHXXXXO01_BS"
The problem is that the 3rd and 4th parameters contain blanks, so the
startSybaseSvcs script is picking up params 3 and 4 as 'Sybase' and
'SQLServer'. How can I pass across the parameters so that they're picked up ...
|
4 |
20.06.2007 14:06:24 |
|
new line in text file with out-file
Hi,
$server = "server1"
$event = "event1"
$ip = "100.10.100.1"
I want to see in file text file:
server1
event1
100.10.100.1
So I tryed to create var and use it with out-host like this
$to_file = "`n$server + `n$event + `n$ip"
out- file -filepath c:\log1.log -append -inputobject $to_file
It's doesn't working.
Please help.
Didi
...
|
3 |
20.06.2007 13:40:22 |
|
find oldest folder
Get-ChildItem -name | Sort-Object CreationTime -Descending | Select-Object
-first 1
For some reason, this line doesn't work properly. When running this line, it
always return wrong folder as oldest. Windows Explorer clearly show oldest
folder in Detail View with Date Created column, but PowerShell doesn't.
Help please....
|
3 |
20.06.2007 12:34:01 |
|
Potenial issue with the get-variable -scope parameter
Hi, this might have been noted already, but the following doesn't seem to
work as expected:
--------------------------------
$z = 777
if ( 1 -eq 1 ) {
$x = 999
get-variable * -scope local
}
--------------------------------
When pasted into the shell, you'd expect that $x would be displayed along
with other local scoped variables, but $z is shown along with all the other
...
|
4 |
20.06.2007 10:06:01 |
|
Powershell Startup
Any way to have powershell run a command automatically at startup ?
Would like to have it log everything by default:
Start-transcript C:\logs\ExchangeShell\Transcript.txt -append
--
Henry Craven {SBS-MVP}
...
|
5 |
20.06.2007 09:55:38 |
|
LDAP Binding troubles
Hi all,
I'm having some difficulty using DirectoryServices with alternate
credentials and am hoping someone can shed some light on this.
>$uname = "domain\uname"
>$pword = convertTo-SecureString "password" -asPlainText -force
>$rdn = "LDAP://my.server:389/dc=example,dc=com"
>$secure = 1
>$myConnection = new-object DirectoryServices.DirectoryEntry($rdn,
$uname, $pword, ...
|
4 |
20.06.2007 09:51:00 |
|
Read from Excel
I want to read specific cells (i.e. A1, C3, F8) from ALL excel files (*.xls)
in current folder. Is this possible?...
|
2 |
20.06.2007 09:43:52 |
|
Using VARIANT in COM
I have a COM object that I have created using new-object -com, and it has
methods that take a parameter of type Variant. How do I create Variant types
in powershell?
--
Douglas Woods...
|
4 |
19.06.2007 23:37:30 |
|
Using Powershell to script VMWare
Is anyone doing this yet? I've got several scripting tasks on my
plate and I'd like to solve them using Powershell, but the knowledge
isn't out there on the net yet. I'm beginning to wade through their
SDK documentation but every time I hit a C# or Java code example it
might as well be Swahili.
Here's the little I have so far that does work:
1. I can use this technique to create a VI S...
|
1 |
19.06.2007 22:56:41 |
|
PowerShell Leaders Join Forces and offer a pre-release version of PowerShell for 50% off the retail value
Shell Tools officially announced that Dr. Tobias Weltner (MVP); author
of the award winning "System Scripter" has joined the company. Weltner
brings with him extensive experience and a robust understanding of the
PowerShell technology.
We have been working closely together on our flagship product -
PowerShell Analyzer, our extensive PowerShell Debugger which will be
integrated in a future ...
|
1 |
19.06.2007 19:42:39 |
|
onvert reg_binary into date format.
C:\>reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
\Print\Environ
ments\Windows NT x86\Drivers\Version-3\HP LaserJet 2420 PCL 6" /v
driverdate
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments
\Windows N
T x86\Drivers\Version-3\HP LaserJet 2420 PCL 6
driverdate REG_BINARY 00C082DA3C66C501
Hello Group,
I'm trying to convert reg_binary...
|
7 |
19.06.2007 08:59:25 |
|
initialising an array with dimension
AFAIK PoSH arrays are value based. When I create a multidimensional
array, for example, I specify values at each of the index points:
$a = @( (1,2),(3,4) )
$a[1][1]
4
Is there a way to define dimensions without actual values? so, for
example, something akin to C# style initialisation:
int[,] a = new int[2,2];
a[1,1] = 4;
Cheers,
n
...
|
9 |
19.06.2007 05:33:58 |
|
Powershell, RegEx, and you (er... ME)
I have to say RegEx is by far my weakest link. Does anyone have any good
"RegEx for Dummies" blogs/posts/info?
Specifically Powershell centric.
--
Brandon Shell
---------------
Stop by my blog some time :)
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject
--------------------------------------
...
|
7 |
18.06.2007 19:51:51 |
|
Why is a copy of $error treated as of type [ref] ?
$error.count
0
$linkedCopyOfError = $error
$linkedCopyOfError.count
0
NoSuch-Cmdlet
The term 'NoSuch-Cmdlet' is not recognized as a cmdlet, function, operable
prog
ram, or script file. Verify the term and try again.
At line:1 char:13
+ NoSuch-Cmdlet <<<<
$error.count
1
$linkedCopyOfError.count
1
$error.GetType().fullname
System.Collections.ArrayList
$linke...
|
3 |
18.06.2007 19:19:31 |
|
Importing CSV into MS SQL Express
Hello All,
I'm trying to parse a whole heap of CSV files in MS SQL 2005 express. The
only way that I can think of doing this is to use the OSQL command using
powershell generate and insert command for each line in the CSV file (yes
time consuming).
However, I have a little snag. The CSV files don't have any column names, as
the first line of the CSV starts with values. e.g.
Row1...
|
5 |
18.06.2007 14:57:25 |
|
Changing prompt color with PSCX
I am using PowerShell Community Extensions and I would like to be able
to change my prompt based on the current directory and the error
status of the last command. Can anyone help me with this? I would
greatly appreciate it as I am new (as of 2 days ago) to using
PowerShell and it seems a daunting task to learn. Baby steps...
David
...
|
3 |
18.06.2007 13:25:33 |
|
1000 users limitation in Active Directory Query
Hi,
While I try to query AD via the Get-qADuser, I get only 1000 users.
I have more then 1000 users.
the -PageSize parameter didn't solve it.
Should I change something in my DCs ?
Thanks
Didi
...
|
5 |
18.06.2007 08:40:53 |