15,992,698 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by MitchG92_24 (Top 23 by date)
MitchG92_24
1-May-13 4:12am
View
Solved it - the problem is a really easy but seemingly stupid one.
(@"\\SERVERNAME\root\sms\site_PR1");
This is wrong (in terms of this project) it must be displayed as:
("\\\\SERVERNAME\\root\\sms\\site_PR1");
MitchG92_24
30-Apr-13 11:54am
View
Using wbemtest both of them result in the same correct outcome for me. Just not in the code. It's frustrating that the SDK doesn't document how to add a computer to a particular collection.
MitchG92_24
30-Apr-13 10:47am
View
by the way yje query works fine when run in wbemtest connected to the site detailed in the managementscope here
MitchG92_24
30-Apr-13 10:40am
View
Hi Dave, was wondering if you could lend any more advice?
I have been trawling the internet all day for answers to my problem with no luck.
string query = "SELECT * WHERE SMS_Collection.Name = 'CollectionName'";
//METHOD ONE - DOESNT WORK - Errors with System.NotImplementedException (although it passes the validity test)
bool querybool = connection.IsQueryValid(query);if (querybool == true){
IResultObject iro = connection.QueryProcessor.ExecuteQuery(query);}
//METHOD 2 - DOESNT WORK - Errors with "INVALID QUERY"
WqlObjectQuery wqlQuery = new WqlObjectQuery(query);
ManagementScope ms = new ManagementScope(@"\\SERVERNAME\root\sms\site_PR1");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(ms,wqlQuery);
ManagementObjectCollection moc = searcher.Get();
Do you have any ideas as to why these methods dont work?
MitchG92_24
30-Apr-13 7:34am
View
ok thank you, i'll get looking into that. You have been a massive help :)
MitchG92_24
30-Apr-13 5:28am
View
Hi Dave - Thank you very much for this reply - it has helped me greatly. I now have some code that will add the computer to a collection, however the collection instance is searched for based on collectionID.
IResultObject collection = connection.GetInstance("SMS_Collection.collectionId=" + "'" + collectionName + "'");
I have tried to search via the collection name as i have seen in the SMS_Collection class that this is a valid field - but im getting errors that its thr wrong object path.
IResultObject collection = connection.GetInstance("SMS_Collection.Name=" + "'" + collectionName + "'");
Can you offer me any advice here at all?
Thank you very much
MitchG92_24
26-Apr-13 8:08am
View
Correction, realised i had the cmdlets it was erroring on commented out (to see that the variables were going in ok). Still have the same problem :( Is there a specific way to ensure that the c# app runs a 32-bit version of powershell on a 64-bit OS?
MitchG92_24
26-Apr-13 6:23am
View
Thank you, that worked perfectly! My scirpt is now running fine.
thanks for the help :)
MitchG92_24
26-Apr-13 6:08am
View
Sorry Zoltan - forgot to include my powershell script. I import the module within the script itself. Do you think it is better practice to do it via c#?
I have included my script in the question now.
MitchG92_24
19-Nov-12 6:43am
View
Thank you, very useful site. I ended up using:
SqlConnection connection = new SqlConnection("Server=SERVERNAME; Initial Catalog=DATABASENAME; Integrated Security=SSPI; connection timeout=30");
And contacted the stored procedure by:
SqlCommand spcmd = new SqlCommand(storedProcedure, connection);
spcmd.CommandType = System.Data.CommandType.StoredProcedure;
MitchG92_24
16-Nov-12 10:43am
View
Sorry, I've been trial and erroring to no avail, so i was hoping for the syntax for the connectionString that i need as i can't find that anywhere. And i'd like to pass string and int values that belong to EventLog Class.
MitchG92_24
14-Nov-12 5:22am
View
It hasn't worked for my use as it needs to operate on earlier .NET frameworks but it is a very useful feature so i shall be using in the future!
MitchG92_24
29-Oct-12 11:38am
View
Hi E.F Nijboer, when i am at my dev machine I will try these. Even if it doesn't work for my particular problem i'm sure for others this may come in handy, I will mark as solution
MitchG92_24
29-Oct-12 10:15am
View
Sorry, I understand I can still use the project just as well as before, but it's just niggling away at me.
In the future when the application has been released I would like the opportunity of debugging the project in runtime for maintenance or bugs, which to the best of my knowledge can be done if ran from the debug folder.
MitchG92_24
17-Oct-12 3:14am
View
I know how to do the actual change of orientation. But it won't allow me to reference the WrapPanel. I feel this is because it is in a template so isnt instantiated until runtime. I've tried finding the control by name way about it but no luck.
It is needed on the code behind because as the items within the WrapPanel change, it needs to switch orientation depending on that.
MitchG92_24
4-Oct-12 3:05am
View
The link in question is the full file path to the .exe that launches the application
MitchG92_24
4-Oct-12 3:04am
View
sorry, I'm running a WPF application. The process being ran is an external application e.g Internet Explorer. I'm only hoping to apply this to applications with a GUI
MitchG92_24
11-Sep-12 5:03am
View
Deleted
There is a quick fix to this programmatically:
string progfiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
if (progfiles.EndsWith("(x86)"))
{
progfiles = progfiles.Replace(" (x86)", "");
}
string progfilesx86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
MitchG92_24
11-Sep-12 5:02am
View
Thanks Kuthuparakkal, i should really pay attention to these background settings!
MitchG92_24
11-Sep-12 4:35am
View
Thanks Carl! i was under the impression i had to run wscript.exe with my vbs file as an argument but alot clearer your way thanks!
MitchG92_24
7-Sep-12 3:50am
View
Thanks Gjersøe! worked perfectly!
MitchG92_24
31-Jul-12 4:58am
View
Thanks Amit, i posted on that forum too and was informed that the sync state of the cached folders is not exposed through the outlook object model or extended MAPI. Very helpful links though!
MitchG92_24
31-Jul-12 4:47am
View
Yes sorry this is using C#, and im using the Microsoft Outlook 14.0 Object Library
Show More