My environment is Windows Server2008R2(EN) + SQLServer2005(EN) + SCCM2007 SP1(EN).
I use a windows service program to query SMS_Collection for all collections in SCCM. It works fine. But after i change the display language to Deutsch, the query result is empty.
After i change the display language i also change the copy settings for current user and the non-unicode display language options.
following is the code I use to query the result.
public List<string> GetAllCollections()
{
try
{
List<string> collectionList = new List<string>();
IResultObject query = SCCMConnection.Current.QueryProcessor.ExecuteQuery("select * from SMS_Collection");
foreach (IResultObject o in query)
{
collectionList.Add(o["Name"].StringValue);
o.Dispose();
}
return collectionList;
}
catch (SmsException)
{
throw;
}
}
public class SCCMConnection
{
private static WqlConnectionManager conMgr;
public static WqlConnectionManager Current
{
get
{
if (conMgr != null)
return conMgr;
SCCMConnection sccmCon = new SCCMConnection();
conMgr = sccmCon.Connect(Dns.GetHostName(), null, null);
return conMgr;
}
}
public WqlConnectionManager Connect(string serverName, string userName, string userPassword)
{
try
{
SmsNamedValuesDictionary namedValues = new SmsNamedValuesDictionary();
WqlConnectionManager connection = new WqlConnectionManager(namedValues);
if (Dns.GetHostName().Equals(serverName, StringComparison.CurrentCultureIgnoreCase))
{
connection.Connect(serverName);
}
else
{
connection.Connect(serverName, userName, userPassword);
}
return connection;
}
catch (SmsException e)
{
return null;
}
catch (UnauthorizedAccessException e)
{
return null;
}
}
}
Is there anything else i also need to change, after i change the display language?
I test my service under Chinese,Japanese and Italian,it works fine. But it also doesn't work under French. I don't know why.
Please help...