Archive

Author Archive

Opalis: Invoke WebService – connection refused

February 10th, 2011 No comments

Let’s say you want to use a .NET webservice that works fine via Internet Explorer or SoapUI.
But when calling it from Opalis you get the error:  “Failed to invoke the Web Service method. The exception was “Unable to connect to the remote server. No connection could be made because the target machine actively refused it 127.0.0.1:5000“” The 5000 is the port number so this can be anything.

Not much to find on the web but the answer is very easy. (once you know it)
You need to be sure that the endpoint address in your web.config is a valid DNS name instead of http://localhost/

 <endpoint address=”http://FQDN/MyWebService.asmx” … />

Don’t forget to restart the website/webservice and clear your cache in Opalis!

Opalis 6.3 released

November 22nd, 2010 No comments

The release was planned for the 27th but there early. This update includes 5 new IP’s.
TechNet Library is live [here] and also the download section. Upgrade from 6.2.2 is only 20mb.

Many were waiting on the “System Center Configuration Manager” and “Virtual Machine Manager” IP!
Robert Hearn discusses the SCCM Pack to explain the features.

Categories: Opalis Tags: , , ,

Bug #600119: confirmed as bug (create user with random password)

November 17th, 2010 2 comments

Recently I reported a bug (see here) via Microsoft because I couldn’t create a new user with a password that was generated by a random string object. Well it is confirmed to be a bug in Integration Pack for Active Directory 2; it will be fixed in the next release.

Full info can be found on the Microsoft Connect site under bug 600119

Categories: Issues, Opalis Tags:

Opalis: move database

November 12th, 2010 No comments

Microsoft explaines in KB2023122 how to move your Opalis DB. The wizard informs you that the database contains tables and that they will be overwritten. Don’t panic and accept the warning, no data gets lost 🙂

Read more…

Categories: Opalis Tags: , ,

*Opalis Issue* Create AD user with random password fails

September 23rd, 2010 2 comments

I have already submitted this to CONNECT but I’m posting it anyway in case more people have the same issue and looking for answers. (Bug ID 600119)

Cannot set “UserPassword” value from a random generated string object. Hard coding a password works, tried all combinations and even up to 20 characters

Error message
– The server is unwilling to process the request. (Exception from HRESULT: 0x80072035) Command Executed [$pwd=ConvertTo-SecureString -string “*******” -asPlainText -force
– $connection=Connect-QADService -Service “POC-dc1” -ConnectionAccount “xxdomainxxAdmin” -ConnectionPassword $pwd
– Set-QADUser -Identity “CN=J324387,CN=Users,DC=DOMAIN1,DC=net” -UserPassword “*****” -Connection $connection] Command Executed [$pwd=ConvertTo-SecureString -string “*******” -asPlainText -force
– $connection=Connect-QADService -Service “POC-dc1” -ConnectionAccount “xxdomainxxAdmin” -ConnectionPassword $pwd
– Set-QADUser -Identity “CN=J324387,CN=Users,DC=nextclient,DC=net” -UserPassword “*****” -Connection $connection] Please make sure you have Powershell and Quest Active Directory command installed on the Opalis Action Server

What feature is this bug related to? Integration Pack

How often does this happen? Always Happens (consistent)

Have you seen this before in the product? I don’t know if this issue existed previously

Reproduction Steps – please list in detail the steps required to reproduce this issue.

Create new policy –> add create user object –> add create random string object -> specify 10 characters (capital, small, numbers, …) -> add reset user password and select password from the random generated string object

Opalis Integration Pack for Microsoft Active Directory v6.1

Categories: Issues Tags: , , ,

Opalis Community Evaluation Program available

September 23rd, 2010 No comments

The Opalis Evaluation Program is now underway!  If you are in the program you will have received this information in an email today.  If you are not in the program and you want to join, you still can!  We will be accepting applications on an ongoing basis … you might just have to catch up and read the Forums!

Log on to http://connect.microsoft.com and go the Opalis application. You will need to fill in a form and your registration will be reviewed before it is accepted.

You can download a VHD-file with v6.3 that includes the upcoming Integration Packs. Read more at Source…

Souce: Technet

Categories: Opalis Tags: ,

Opalis demo by SCUG

September 13th, 2010 No comments

As you could read in a earlier post SCUG.BE organised a demo to let people become familiar with Opalis. We saw some demos and also a quick peak of the upcoming Integration Packs. The demo was given by Alexandre Verkinderen.

I’m especially looking forward for the Virtual Server IP to automate the creation of new VM Servers!

Click on Read More to see some pictures of the demo! Read more…

Categories: Opalis Tags:

PowerShell: count items per folder

August 26th, 2010 No comments

This script is created to count how many folders exist in a NAS Share. It loads the list from SQL Server and writes the result back to the same table. You can modify it to your own needs.

# **********************************************
# Created by Sébastien Morel
# http://blog.elmore.be
# Last update: August 26th, 2010
# Version 1.00
#
# This script will loop NAS Folders
# and return number of homefolders per share
# **********************************************

# retrieve NAS Folders
$sqlsvr = '&lt;MySQLServer&gt;'
$database = '&lt;MySQLDB&gt;'
$table = 'tbl_homeshares_trees'

Clear-Host
Write-Host &quot;Please wait a moment, this can take a while...&quot;
Write-Host &quot; &quot;

#Create SQL Connection
Write-Verbose &quot;Creating SQL Connection...&quot;
$conn = New-Object System.Data.SqlClient.SqlConnection(&quot;Data Source=$sqlsvr;Initial Catalog=$database; Integrated Security=SSPI&quot;)
$conn.Open()
$conn2 = New-Object System.Data.SqlClient.SqlConnection(&quot;Data Source=$sqlsvr;Initial Catalog=$database; Integrated Security=SSPI&quot;)
$conn2.Open()

$cmd = $conn.CreateCommand()
$cmd2 = $conn2.CreateCommand()

$cmd.CommandText = &quot;select tree_id, tree_path from $table&quot;
$Reader = $cmd.ExecuteReader()

while ($Reader.Read()) {
	$sID = $Reader[&quot;tree_id&quot;].Tostring()
	$sPath = $Reader[&quot;tree_path&quot;].Tostring()
	Write-Host &quot;Querying $sPath...&quot;
	$sGo = Get-ChildItem $sPath
	# update table
	$cmd2.CommandText = &quot;UPDATE $table SET tree_count = &quot; + $sGo.Count + &quot; WHERE tree_id = '&quot; + $sID + &quot;'&quot;
	$cmd2.ExecuteNonQuery() | Out-Null
}

$conn.Close()
$conn2.Close()
$Reader.Close()

The results in the database

Categories: Powershell Tags: ,

PowerShell: delete files older than x days

August 25th, 2010 1 comment

Classical script and we all need it some day. Edit the folder path and adjust the number of days to your clean-up schedule. The script works recursive so it will also clean-up subfolders.

As always, make sure you can execute PowerShell scripts

Set-ExecutionPolicy RemoteSigned

The Script…

$Now = Get-Date
$Days = &quot;30&quot;
$TargetFolder = &quot;C:WINDOWSsystem32LogFiles&quot;
$LastWrite = $Now.AddDays(-$days)
$Files = get-childitem $TargetFolder -include *.log, *.txt -recurse | Where {$_.LastWriteTime -le &quot;$LastWrite&quot;} 

foreach ($File in $Files){
	write-host &quot;Deleting File $File&quot; -foregroundcolor &quot;Red&quot;;  Remove-Item $File | out-null
}
Categories: Powershell Tags: , ,

Exchange 2000/2003: count mailboxes per store

August 24th, 2010 2 comments

A client of me wants to automate the creation of exchange mailboxes but the load needs to be spread among the 5 exchange servers. Each server has 4 storegroups and 4 stores making a total of 80 locations. So I wrote a PowerShell script that queries each Exchange Server and counts mailboxes per store. This job will run each night and the results are written to a SQL Server database (company policy)

The configuration is easy and is located at the top of the script. You can choose to send the results to the screen or to SQL Server

$tempfile = &quot;Temp.csv&quot;
$exportfile = &quot;Exchange_stores.txt&quot;
$exportcsv = &quot;Exchange.csv&quot;
$output = &quot;screen&quot;; # sql - screen

Decide if you want to load a serverlist from a text-file or from the script

# Get list from array or txt-file (un-comment what you want)
# -----------------------------------------------------------
$exServers = &quot;Dummy1&quot;,&quot;Dummy2&quot;
#$exServers = Get-Content ExchangeServers.txt

SQL-Server Configuration

# SQL Server configuration (only needed when output = sql)
# -----------------------------------------------------------
$sqlsvr = '&lt;mysqlserver&gt;'
$database = '&lt;mysqldatabase&gt;'
$table = 'tbl_exchange_servers'

The Create-table script is included and looks like this

CREATE TABLE [dbo].[tbl_exchange_servers](
	[server_id] [int] IDENTITY(1,1) NOT NULL,
	[server_name] [varchar](100) NOT NULL,
	[server_storegroup] [varchar](100) NOT NULL,
	[server_storename] [varchar](100) NOT NULL,
	[server_mailboxcount] [int] NOT NULL
) ON [PRIMARY]

The output to the screen will look like this

Download: ExchangeStats.zip

*Update*
v1.03: fixes a bug for the export to SQL Server where the variables contained an unwanted space

All comments are welcome 🙂

Full Script

# **********************************************
# Created by Sébastien Morel
# http://blog.elmore.be
# Last update: August 24th, 2010
# Version 1.03
#
# This script will loop exchange servers
# and return number of mailboxes per store
# **********************************************

$tempfile = &quot;Temp.csv&quot;
$exportfile = &quot;Exchange_stores.txt&quot;
$exportcsv = &quot;Exchange.csv&quot;
$output = &quot;screen&quot;; # sql - screen

# Get list from array or txt-file (un-comment what you want)
# -----------------------------------------------------------
$exServers = &quot;Dummy1&quot;,&quot;Dummy2&quot;
#$exServers = Get-Content ExchangeServers.txt

# SQL Server configuration (only needed when output = sql)
# -----------------------------------------------------------
$sqlsvr = '&lt;mysqlserver&gt;'
$database = '&lt;mysqldatabase&gt;'
$table = 'tbl_exchange_servers'

Clear-Host
Write-Host &quot;Please wait a moment, this can take a while...&quot;
Write-Host &quot; &quot;

# Delete old output file when needed
if ([System.Io.File]::Exists($tempfile)) { [System.IO.File]::Delete($tempfile) }
if ([System.Io.File]::Exists($exportfile)) { [System.IO.File]::Delete($exportfile) }
if ([System.Io.File]::Exists($exportcsv)) { [System.IO.File]::Delete($exportcsv) } 

foreach ($server in $exServers) {
	Write-Host &quot;Querying $server ...&quot;
	$mbx = get-wmiobject -class Exchange_Mailbox -namespace RootMicrosoftExchangeV2 -computername $server
	$mbx | Group-Object StoreName,StorageGroupName,Servername -NoElement | Sort-Object Count -Descending | Export-Csv -NoType $tempfile -Delimiter (';')
	[System.IO.File]::ReadAllText($tempfile) | Out-File $exportfile -Append -Encoding Unicode
}

Write-Host &quot; &quot;
If ($output -eq &quot;sql&quot;){
	Write-Host &quot;Importing results to SQL Server...&quot;
	Write-Host -Fore Green &quot;Updating Table&quot;
	$myCollection = @()
}

# remove blank lines from the export-file
(get-content $exportfile) -replace '&quot;','' | where {$_ -ne &quot;&quot;} | out-file $exportfile
# import results to SQL Server
$sr = [System.Io.File]::OpenText($exportfile)
$s = $sr.ReadLine()
While ($s) {
	$s = $sr.ReadLine()
	If ($s -ne $null -and $s.Contains(&quot;ArrayList&quot;)){
		$val = $s.split(&quot;;&quot;)
		$numMailbox = $val[1]
		$names = $val[3].split(&quot;,&quot;)
		$sStore = $names[0].Trim()
		$sStorageGroup = $names[1].Trim()
		$sServerName = $names[2].Trim()
		If ($output -eq &quot;screen&quot;){
			write-host $sServerName $sStorageGroup $sStore : $numMailbox
		} else {
			$myobj = &quot;&quot; | select Server,StoreGroup,StoreName,MailboxCount
			$myobj.Server = $sServerName
			$myobj.StoreGroup = $sStorageGroup
			$myobj.StoreName = $sStore
			$myobj.MailboxCount = $numMailbox
			$myCollection += $myobj
		}
	}
}
If ($output -eq &quot;sql&quot;){
	$myCollection | Export-Csv $exportcsv -notype
	#Create SQL Connection
	Write-Verbose &quot;Creating SQL Connection...&quot;
	$conn = New-Object System.Data.SqlClient.SqlConnection(&quot;Data Source=$sqlsvr;
	Initial Catalog=$database; Integrated Security=SSPI&quot;)
	$conn.Open()
	$cmd = $conn.CreateCommand()

	#truncate current table
	$cmd.CommandText = &quot;TRUNCATE TABLE $table&quot;
	$cmd.ExecuteNonQuery() | Out-Null

	Import-Csv .$exportcsv | % {
	#$_.Server
	#$_.StoreGroup
	#$_.StoreName
	#$_.MailboxCount

	#Create query string
	#Must matching the table layout (server_name, server_storegroup, server_storename, server_mailboxcount)
	$cmd.CommandText = &quot;INSERT INTO $table (server_name, server_storegroup, server_storename, server_mailboxcount) VALUES ('$($_.Server)','$($_.StoreGroup)','$($_.StoreName)','$($_.MailboxCount)')&quot;

	#Execute Query
	$cmd.ExecuteNonQuery() | Out-Null
	}
}

[system.Io.File]::Delete($tempfile)
$sr.close()
[system.Io.File]::Delete($exportfile)
[system.Io.File]::Delete($exportcsv)

Write-Host &quot;Finished!&quot;
Categories: Opalis Tags: , , , , , ,