IDE :: Powershell To Manage Our Exchange Infrastructure?

Feb 25, 2010

We use VB2005, Along with Powershell to manage our exchange infrastructure. VB.Net codes have been compiled to support MIIS2003 Operations. One of the operations require the functions in VB.net to write an output into .csv file. This file receives jibberish characters as input after the functions are executed.

View 1 Replies


ADVERTISEMENT

ASP Modifying Exchange 2k7 Mailboxes With Powershell Execution?

May 8, 2012

I'd like to start off by saying I'm not really a programmer just a sysadmin who likes to dabble (so simple answers would be nice ;) ),I've created a webapp that's used by some less technical folk to do basic administration tasks(User provisioning through our IDM, Updating passwords, Disabling accounts, Editing user details, etc)there's also a couple of exchange functions that are currently handled by exporting a CSV that a separate powershell script processes.I'm trying to bring these powershell functions into the application to reduce complexity but I'm having some trouble.

When I execute the "Add-MailboxPermission" command I get no return output (nor does it apply the change) at all, unless I put no parameters,in which case it throws the expected missing parameters exception (Not scientific but proves it's loading the exchange plugin fine and executing):

private sub cmdMbxFullAccess(sender as object, e as eventargs)
Dim psRunSpaceConf As RunspaceConfiguration = RunspaceConfiguration.Create()
Dim psConfException As PSSnapInException[code].....

If however I issue a simpler command like "Get-Host | Out-String" I get return output as expected. Thus far I have checked that the user context it's running under has the correct permissions and tried executing the command from the powershell prompt on that server to make sure that there isn't some other external issue I am overlooking.how I can further debug this, it's like the command disappears into the ether never to be heard from again!

View 2 Replies

ASP/.NET Modifying Exchange 2k7 Mailboxes With Powershell Execution?

May 8, 2012

I'd like to start off by saying I'm not really a programmer just a sysadmin who likes to dabble (so simple answers would be nice ;) ), I've created a webapp that's used by some less technical folk to do basic administration tasks (User provisioning through our IDM, Updating passwords, Disabling accounts, Editing user details, etc) there's also a couple of exchange functions that are currently handled by exporting a CSV that a separate powershell script processes. I'm trying to bring these powershell functions into the application to reduce complexity but I'm having some trouble.

When I execute the "Add-MailboxPermission" command I get no return output (nor does it apply the change) at all, unless I put no parameters, in which case it throws the expected missing parameters exception (Not scientific but proves it's loading the exchange plugin fine and trying to execute):

[Code]...

View 1 Replies

Infrastructure For Music CD Collection Datasabe?

Aug 1, 2008

I have been given the following informationA user owns a collection of music CDs and wishes to store information about them on a computer. For each CD the user wants to store:

* title
* genre (type of music)
* artist

[code]....

And here is what I am trying to doCreate a CD database - divide into tables with appropriate fields, primary keys, and foreign keys. Put in enough data to show that it works - say, five CDs with three songs each. You may make up the data or take it from real CDs. Use the CP212.mdf.zip file to create your database. (Ignore or delete the other tables in the file.)I have already done a similar task with student database. Where we made Course table, student table, student course table and subject table. We had to register a student in a student course by joing studnet info and course info. All I wanted to know what table am I suppose to make t

View 10 Replies

Calling Powershell From VB?

Nov 24, 2010

Im trying to create an app that will do some funky things with new users/leaving users and apply a load of business requirements around this. After playing about with Powershell forms, ive decided to embedd powershell within a VB.net app.I am using the following code, which is always returning "Nothing", as in no result, which is causing me a real headache. The same code works with Get-QADuser, and Get-Command, just not Get-Mailbox.I will also need to call New-Mailbox and othe commands later on in the proces.

Imports
System.Management.Automation.Runspaces
Imports

[code]....

View 1 Replies

Powershell Via VB Which Method And Why

May 16, 2012

I need to call Powershell commands via my code and I find at least 2 different examples of doing this. I'm wondering what the differences between the methods are and why I would use one as opposed to the other.The first (simpler?) method goes something like this:

[code]...

I also know that with either method I can pipe the command to out-string to make Powershell return strings instead of objects.My question is, which method should I use and why? They both seem the same to me.

View 1 Replies

Manipulating Windows ACL With PowerShell?

Dec 12, 2011

I have a file full of last-names separated by commas and then first-names.

Smith,Bob
Chicken,Ronald
Car,Anastasia

Code:
gc permissions.csv|% {$_.split(",")[0]}

I'd like to grab the first character of the first name and then pre-pend it to the string of the last name. The general idea is to find the user ID that's stored in Active Directory, in my company it's the first letter of the first name and then the last name.

Then I'm trying to add these users as read-only on a specific directory.

View 2 Replies

Powershell ConsoleShell.Start?

Jul 28, 2010

Running the following code resulting in an HostException;

Public Sub RunPowershellInConsole(ByVal scriptText As String)
Dim config = RunspaceConfiguration.Create
Dim args() As String = New String() {scriptText}

[code].....

View 1 Replies

VBScript Or Powershell Scripting

Jun 4, 2012

I took the dive into learning VBScript due to some server side scripts that I work with. During a course I ran into Powershell and did some Google searching. From what I was reading, VBScript is good for legacy applications and Powershell is the way to go for Win7. I did not run into anything telling me of this being true or if its a false statement and VBScript will be used for Win7 and Win8. Should I look into learning Powershell and abort my VBScript for now and just worry about VBScript for legacy systems?

View 1 Replies

WMI Win32_PhysicalMemory Class Using PowerShell

Mar 29, 2010

I am trying to create a programma that gathers system data like CPU name and speed and Physical Memory things like that

i succeeded in loading the data i use:

Dim searcher As ManagementObjectSearcher = _
New ManagementObjectSearcher("select * from Win32_Processor")
For Each oReturn As ManagementObject In searcher.Get()

[Code].....

View 10 Replies

Execute Remote Powershell Commands Using C#?

Feb 25, 2012

I'm evaluating the best approach to implement the following periodic task:

Get some users from SQL Server (2008) and then for each user enable licences in the Cloud (Office 365) using PowerShell.

My first thought was a console-based app in C# or VB.net but now that I realize that running a PS Script remotely using C# can be quite a challenge I'm starting to think in alternatives like perform all the stuff using PowerShell, I guess this is a better approach but I'd like to hear your thoughts on this.

View 2 Replies

Load Powershell Module Via .NET Code?

May 18, 2012

I have to call PS commands from a VB.NET program. This works fine if I'm calling standard PS commands, but if I have to call a command that lives in a 3rd party module I can't seem to make it work. At the PS console I can type Import-Module MyModule and then I can call the commands in that module. I tried the following but it doesn't work, I still can't access my command from within the module:

Dim PowerShell As Management.Automation.PowerShell = PowerShell.Create()
Dim PowerShellCommand As New PSCommand()
Dim PowerShellCommandResults As Object

[code].....

View 1 Replies

Powershell Ignoring Quotation Marks?

Jul 20, 2011

I have a Powershell script and no matter what I try it completly ignores any quotation marks in the script. The error occurs when I run the script from my VB.NET code yet, I have been running scripts sucessfully through VB.NET for a while now. For example, my script starts with finding out the server name...

[Code]...

View 3 Replies

Powershell Piping Results From One Command To Another

Dec 8, 2010

I currently have an ASP.NET programming creating a Powershell CmdLet to create a mailbox in exchange. The issue I'm having is sometimes is fails to create the mailbox because "it can't find" the exchange database I am specifying. So what I'm trying to do is run a Get-Mailbox and then pipe the results to an Enable-Mailbox command. Below is the code I am using to do it:

[Code]...

View 1 Replies

Running Powershell Scripts From Within A .NET Windows App

Jul 28, 2010

I'm needing to run scripts from within a vb.net windows app. I've got the scripts running in the background fine;

[Code]...

View 1 Replies

VS 2010 Calling Powershell File

Jun 9, 2011

I'm currently having issues calling a .ps1 file in my vb.net project. The program is supposed to provide a simple way for end users to unlock Active Directory accounts. The vb.net project is simply a text box with a button. Users will type the username of the locked account. When the button is pressed, the program writes whatever is in the text box into a CSV file. The CSV file has a samAccountName column in it. After the file is written to, the program then calls a Powershell script that reads the CSV file and unlocks the account based upon what is in the file.The program does everything it is supposed to except for calling the Powershell script to actually unlock the account. I've tried a Process.Start(filePath) which would open the file, but opened in notepad and didn't execute anything. Right now the program is calling a batch file which is supposed to run the script in Powershell but that attempt also failed.

View 3 Replies

Powershell - Return Custom Object To C# Host?

Apr 26, 2011

I have the following powershell script which loads a custom .NET DLL this contains the ScriptResult class, it is intern executed from a VB.NET app.

Add-Type -Path $myLibPath
$result = New-Object TheLibrary.ScriptResult

[code].....

View 2 Replies

PowerShell Host And Standard Error Output

Aug 15, 2011

I wonder if it is possible to write and capture errors when running a script to PowerShell.In my case I am using the following code:[code]' add an extra command to transform the script output objects into nicely formatted strings' remove this line to get the actual objects that the script returns, for example, see the script "Get-Process" returns a collection.[code]

View 4 Replies

Powershell: Disabling Windows.Forms Resize?

Jun 13, 2012

Just a quick question, I want to stop the end users from being able to resize a GUI that I've created.

$objForm = New-Object System.Windows.Forms.Form
$objForm.Text = "ADX v2.1.2.0"
$objForm.minimumSize = New-Object System.Drawing.Size(965,665)

[code].....

View 2 Replies

Running Powershell Directly From Visual Basic?

Apr 1, 2011

I followed Ziannb article on involking powershell from visual basic. It works great but it doesnt allow me to run scripts with [URL]

- how can i run powershell scripts with arguments from VB

- how can i run one powershell command line at a time from VB. When i use below two command, it pipes the first command to the second one..instead of running them individually :

MyPipeline.Commands.Add("get-childitem")
MyPipeline.Commands.Add("get-date")

View 2 Replies

Show Real-time Output By Running A PowerShell Script?

Mar 1, 2012

I am trying to run powershell script from VB and I want to see the output of the script as it is running inside a console application. With my script (shown below) when I run from powershell it shows "Command Sleep Starting" and then waits for 5 seconds and then displays the other text.

However, when I run from VB.NET program, the execution waits for 5 seconds and dumps all the text output at once. It doesn't execute first Write-Output command and then wait and then output as it should.[code]...

View 1 Replies

.Net Exchange Web Services?

Aug 31, 2011

I created an application using the Exchange Web Services, everything works fine, but after running 3 or 4 times, I suddenly get the error:

There was an error downloading "whatever/ews/services.wsdl"The remove name could not be resolved:There was an error downloading "whatever/ews/services.wsdl/$metadata"That gets me is its working find for a while, then it just stops working. I do an update and get the error. wait a little longer, try to browse it through browser and it prompts me for a user name and password, even though I checked the box "Remember".

View 1 Replies

Ews (Exchange Web Services)?

Jun 12, 2009

I'm looking at using ews to move new emails to a sub folder and download attachments to a network drive. I was wondering if anyone had any experience with this particually using VB.net but all and any advice?

View 1 Replies

Using Ews (Exchange Web Services?

Mar 11, 2009

I'm looking at using ews to move new emails to a sub folder and download attachments to a network drive. I was wondering if anyone had any experience with this particually using VB.net but

View 2 Replies

Asp.net - How To Manage An IF Statement

Nov 17, 2011

I have a total of 102 values associated with a fieldname called ArrivedFlag.Then I have a TextBox control with an id of txtFlag on the markup page.In my codebehind, I have an if statement that says:

If txtFlag <> "value1" and txtFlag <> "another value" Then
lblMessage.Text ="You don't have the ability to view details"
end if

This works fine.However, given that there are 102 values, I feel that doing an IF statement 102 times is a bit inefficient.

Dim allowedFlags = New List(Of String)()
With { _
"value1", _
"another value"

[code]....

View 4 Replies

Best Way To Manage GUI States

Dec 11, 2011

I was asked by a client to create a tool that would let a user add/modify/delete/read content from a database. The content can be read from TextBoxes.

My question is, what is the best way to manage GUI locks/unlocks for the different states of the program. IE: If I'm in a "insert" mode, some GUI elements should be enabled, and some not. If I'm in the "read-only" mode, a bunch of them should be disabled... etc.

View 1 Replies

Best Way To Manage Strings?

Aug 21, 2010

I am writing a program that uses an array with three columns and a varying amount of rows. I need to load info on a list of files in an archive(specifically: file name, size, path), and I am wondering what the most convenient way to store strings(to be loaded into the array) is.

For example: I tried creating a new .resx file in my project, and writing a function to be executed on form1_load that reads the strings from the .resx file and places them in the array in their correct column, but unfortunately had no success.

I really have no idea how resx files work, I can put strings in them using the resource editor, but I don't know how to retrieve them using resourcemanager.

I would just put the info straight into an array, but it's much easier to update a .resx file when the archive changes than it is to update the code.

Could someone please tell me how to use .resx files in vb.net? Or an easier way of accomplishing my goal?

View 7 Replies

Can't Manage To Add Different Values Together

Feb 3, 2011

I can't manage to add different values together...

TextBoxAnswer.Text = TextBox1.Text + TextBox2.Text + TextBox3.Text + TextBox4.Text

I import decimal values from my SQL Server into the TextBoxes 1-4, which works fine. But when I try to add the values together into another textbox the answer is just the values combined like a string...?The column of the table in the SQL server has a datatype decimal(18, 2)I have also tried to convert the values in the textboxes into int, str, double... Nothing seems to work...

Example:

Answer = 2,50 + 2,50 + 5,50 + 4,50
So,
TextBoxAnswer.Text = 10,00

but, all I get is:

2,502,505,504,50

View 3 Replies

How To Manage Directories

May 29, 2012

I am now convinced there is no such thing using VB 2010 Express. I have read, re-read, studied, copied and pasted code to no end and all I get are error messages galore. It appears there is a big gap between what's on line as far as tutorials and the code that VB 2010 Express will accept. I hate to sound so lost but at the moment I am. I used to program in BASIC and QBASIC. I was a master at opening up ascii text files, reading them in sequential order, sorting, manipulating, then re-writing them. It was all so easy, like this: [code] That's all I want to learn how to do for the moment. But every tutorial or article I find goes off in to wild tangents about How to Manage Directories or it reads the entire text file into one giant object. Or worse, there's some code which looks promising but it won't run under VB 2010 Express or it might run but the author leaves out important parts of the code that have to be declared ahead of the subroutine....you all know what I mean. It can't be this difficult to just read a text file one line at a time, therefore it shouldn't be so difficult to find an accurate and up to date article on this.This is for really rough programming. I don't need an interface of any kind. The user, will not even need to know that anything is happening. I simply want to read text files, manipulate what's in them and then re-write the edited text.

View 5 Replies

How To Manage Tables Or Any Other Way

Jun 8, 2011

im using dreamweaver and i have a table in which i have an image. When i add another table under the table existing it comes right at the bottom. What should i do to that table so i can move it and place it anywhere around the page. displaying my data wherever i want. And another problem is that, when i place something on the top it doesnt show up there it comes slighty away from where i had placed.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved