15,908,841 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 Python 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 notjustme (Top 19 by date)
notjustme
4-Oct-18 14:32pm
View
Thank you very much, you clearly interpreted this question the same way as I did.
notjustme
4-Oct-18 13:17pm
View
This makes no sense what so ever... Any way to report this question?
notjustme
28-Oct-16 14:59pm
View
http://lmgtfy.com/?q=script+environment+variables+windows
notjustme
12-Jul-16 13:53pm
View
Arrayofservers = Array(Servers) <-- This doesn't mean anything in PowerShell.
notjustme
27-Feb-15 14:41pm
View
If your goal is to do this in C# or vbs, why tag PowerShell and VB.NET? Assuming I provide you with the solution, what and how do you intend to pay me? This obviously is you placing an order rather than asking for help with a programming issue.
notjustme
18-Apr-14 4:02am
View
I've shown you how to do this in your original post.
notjustme
17-Apr-14 14:26pm
View
I actually explained how to solve this to the original poster about a month ago.
Adding "-ReferencedAssemblies "C:\Here\Are\My\dlls\System.Xml.dll" to the Add-Type command will make the code work. This question is a duplicate really.
notjustme
17-Apr-14 10:24am
View
Editing your original question and not adding any more information won't really help you.
By finding the exact path to the actual DLLs I can get your code to load;
Add-Type -TypeDefinition $source -Language CSharp -ReferencedAssemblies "C:\Here\Are\My\dlls\System.Xml.dll", "C:\Here\Are\My\dlls\System.Linq.dll" etc, etc.
notjustme
21-Mar-14 9:34am
View
If you find the full path for the dlls you should be able to load them.
notjustme
21-Mar-14 9:01am
View
What PowerShell version are you using and as what user are you trying to run this? As long as the referenced assemblies are in the GAC this should be possible.
Do you get any useful information if you run the following line in PowerShell;
[System.Reflection.Assembly]::LoadWithPartialName("System.Collections")
notjustme
24-Feb-14 21:51pm
View
You're gonna have to adjust your path to your mapping then (like $a=Get-ChildItem Z: instead of what you have now). What is the error you're getting?
On a sidenote, if that's your real user/pass you migth wanna edit that out before pasting your code here.
notjustme
16-Feb-14 0:47am
View
It was actually your code, I just added the path you mentioned. However, the $ in $a got cut out when I copied your code.
notjustme
11-Jul-13 12:09pm
View
Try it like this;
Get-ADUser -Filter 'Enabled -ne "true"'
notjustme
11-Jul-13 11:02am
View
I'm finding it quite cumbersome to read through that code with all the german words.
notjustme
1-Apr-13 13:27pm
View
Deleted
Perhaps you could build the complete command line before firing powershell up.
[erased stuff, brain farting... please hold] :)
notjustme
10-Mar-13 8:05am
View
Get-Eventlog never even gets to use the credentials you've specified. If you don't have the rights to access the eventlog with the current user you could run PowerShell as one that has.
If it's used in like a scheduled job you could run it as the desired user there, just make sure that the particular service account has 'log on as batch job' rights.
Storing passwords in plain text in a file gives me the hives but here's another option that might work for ya if you have remoting (Get-Help about_remote) enabled (code hasn't been tested but should be in the ballpark);
$server='host_name'
# Since $pwd is one of PowerShell's automatic variables I named it $passwd instead.
$passwd= convertto-securestring 'password' -asplaintext -force
$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist 'domainname\username',$passwd
Invoke-Command -ComputerName $server -Credential $cred -Scriptblock { Get-Eventlog -LogName Application }
notjustme
1-Mar-13 18:36pm
View
Perhaps this has been solved already but...
What does your $ftp variable actually end with? Like "somedomain.com", "somedomain.com/" or something else?
If it's the first one try adding the '/' to the ftp variable or inbetween "$ftp+$item.Name" when creating your URI-object.
notjustme
12-Apr-12 15:00pm
View
Have you checked this out?
http://technet.microsoft.com/en-us/library/dd630736.aspx
[
^
]
notjustme
13-Mar-12 15:13pm
View
Ops, that was supposed to be a comment/question rather than a solution. I apologize. :)
----
Granted, I'm a beginner so maybe I'm missing something here. However I'm curious about this lil bit of your code;
string subpath = @"c:\users\khan\documents\visual studio 2010\Projects\Crime System\Crime System\Database1.mdf";
string subpath2 = @"C:\Users\khan\Documents\Visual Studio 2010\Projects\Crime System\Crime System\Database1_log.ldf";
string sh = Directory.GetDirectoryRoot("dirinfo.txt");
path = sh + subpath;
path2 = sh + subpath2;
If we assume "dirinfo.txt" is on your C-drive, wouldn't path and path2 become something like "C:\c:\users..."? Like I said though, I'm a beginner so maybe I'm missing something here. Smile | :)
Show More