w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Remote Registry using Enter-PSSession
foreach($computer in $strComputer) { Enter-PSSession $computer -Credential $cred .. .. } The above code won't work. Enter-PSSession is not for using in a script. Anything written after that in a script won't run. Instead, use Invoke-Command and pass rest of the script block as a parameter value. For example, foreach ($computer in $strComputer) { Invoke-Command -ComputerName $computer -Credential $cred -ScriptBlock { Set-Location HKLM:SOFTWAREMicrosoftWindowsCurrentVersionReliability $systemInfo = Get-Item -Name LastComputerName Write-Host $systemInfo } }

Categories : Powershell

Enter-PSSession to custom endpoint: Cmdlet not recognized
There is the option to disable each cmdlet in advance by using -SessionType Default with the -ScriptsToProcess 'C:ScriptsLoggerEpStartup.ps1' Parameter when creating a SessionConfiguration. New-PSSessionConfigurationFile -Path C:ScriptsLoggerEp.pssc ` -SessionType Default ` -LanguageMode FullLanguage ` -ExecutionPolicy Unrestricted ` -ModulesToImport 'RcLogUtil' ` -VisibleFunctions 'Out-LogToEventLog' ` -ScriptsToProcess 'C:ScriptsLoggerEpStartup.ps1' C:ScriptsLoggerEpStartup.ps1: # Commands needed by PSSession (Also the commands used when # creating a RestrictedRemoteServer ) $CmdsToExclude = @( 'Get-Command' , 'Out-Default' , 'Exit-PSSession', 'Measure-Object', 'Select-Obj

Categories : Powershell

Powershell Using Start-Process in PSSession to Open Notepad
That is because your powershell session on the remote machine does not go to any visible desktop, but to an invisible system desktop. The receiving end of your powershell remote session is a Windows service. The process is started, but nor you nor anyone else can ever see it. And if you think about it, since multiple users could RDP to the same machine, there is really no reason to assume a remote powershell session would end up showing on any of the users desktops. Actually, in almost all cases you wouldn't want it anyway. psexec with the -i parameter is able to do what you want, but you have to specify which of the sessions (users) you want it to show up in.

Categories : Powershell

Powershell Remoting with credential
You can do: $cred = get-credential #fill you credential in the pop-up window and then: Invoke-Command -ComputerName mycomputer -ScriptBlock { Get-ChildItem C: } -credential $cred Remember that the password in $cred is easily recoverable in clear text!

Categories : Powershell

How to subscribe for "user enter command to prompt" event in powershell?
I'm not sure if I understand what you are asking completely, but does this help? http://jaworskiblog.com/2011/08/05/logging-all-powershell-commands-and-output/ Basically, you add a "Start-Transcript" to your powershell profile. That will log everything you do even across multiple powershell instances, I think...

Categories : Powershell

Get JTextArea current row text on Enter Key
Hhehe, solved it by myself: Here's the correct code for what I'm looking for: if (evt.getKeyCode() == 10) { try { int offset=ta.getLineOfOffset(ta.getCaretPosition()); int start=ta.getLineStartOffset(offset); int end=ta.getLineEndOffset(offset); System.out.println("Text: "+ta.getText(start, (end-start))); } catch (BadLocationException ex) { System.out.println(ex.getMessage()); } } Maybe it's useful to another guy out there :)

Categories : Java

Date Validation - Only enter dates within current month
Use the ASP.NET Validator controls, like this: Markup: <asp:TextBox id="YourTextBox" runat="server" /> <asp:RequiredFieldValidator ControlToValidate="YourTextBox" Text="The date field is required!" runat="server" /> <asp:CompareValidator ID="compareValidatorDate" ControlToValidate="YourTextBox" Type="Date" Operator="LessThan" ErrorMessage="Date must be from this month!" Display="Dynamic" runat="server" /> Note: I have included the RequireFieldValidator to ensure that we have a value to compare against for the date validation. Code-behind (Page_Load): If Not IsPostBack Then Dim firstOfTheMonthDate As DateTime = FirstDayOfMonthFromDateTime(DateTime.Now) Me.compareValidatorDate.ValueToCompare = firstOfTheMonthDate.ToString("d") End If Code-behi

Categories : Javascript

jquery autocomplete - need enter key to process current search phrase
You can try something like: function sendSelected(_val){ var search_input = _val; if (search_input =='') search_input ='*'; var dataString = 'keyword='+search_input; if (search_input.length > 2 || search_input=='*') { $.ajax({ type: "GET", url: "core/functions/searchdata.php", data: dataString, success: function(server_response) { $('#searchresultdata').empty(); $('#searchresultdata').append(server_response); $('span#category_title').html(search_input); } }); } } $("#SearchPhrase").keypress(function(e) { if(e.keyCode == 13) { e.preventDefault(); sendSelected(this.value); $(this).autocomplete('close'); } });

Categories : Jquery

how to deactive enter event (only enter no shift+enter) in contenteditable
You can use the keydown event for this. Mdn has more information about this event. With the following example html: <div id="pinky" contenteditable="true">Pink unicorns are blue</div> You can attach an keydown event handler to this element. We can then use the event.shiftKey to detect if the shiftKey is pressed together with our enter key. Key 13 is either of the "enter" keys. $('#pinky').on('keydown', function(e) { if (e.which == 13 && e.shiftKey == false) { //Prevent insertion of a return //You could do other things here, for example //focus on the next field return false; } }); This snippets shows this in action: $('#pinky').on('keydown', function(e) { if (e.which == 13 && e.shiftKey == false) { //Prevent insertion of a r

Categories : Jquery

Intellij IDEA: equivalent of Eclipse's "Complete Current Statement" (Ctrl+Shift+Enter)?
Is this Feature present in Eclipse ( at least even as a plugin will be fine ) . I use Ctrl+Shift+enter in IntelliJ a lot . Some of the things it will do are if it is normal statement then it will format the current line and add semicolon ( also the cursor position will be end of the line ) if it is a loop/conditional like for,if etc if -> if ([cursor position]) { } -> if() { [cursor position]} [ -> means ctrl + shift + enter command ] If statement is already completed then it will format the current line and goes to next line indented position. people might think these things are very trivial/not important but only when you try to use this you will find how useful this small feature will be and how much you miss in eclipse .

Categories : Java

Powershell: Update current output line
Use carriage return to return to the start of the line: `r See this: http://ss64.com/ps/syntax-esc.html And definition of carriage return: http://en.wikipedia.org/wiki/Carriage_return If you want to clear a line, that and a load of spaces. Otherwise you can overwrite stuff. I can't really write up an example here as it's SO's code character, but put it at the start of the "world" string and it should work. Hope this helps!

Categories : Powershell

java code that allow to enter some words to it until I enter a space, then it output the same string with dash
The solution to your homework (don't tell the professor): import java.io.*; public class whatever { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringBuffer buffer = new StringBuffer(); String str; while((str = in.readLine()) != null && !str.equals(" ")) { buffer.append(str); } System.out.println(buffer.toString().replace(" ", "-"); } } You must put it in a file called whatever.java.

Categories : Java

Can I close a validation dialog box with enter key but not submit textbox value but use enter for valid value?
Without being able to see the rest of your code, you could have an event listener on submit, do e.preventDefault() and sub in whatever you want for the input values before manually submitting the form via JS.

Categories : Javascript

why ember.js use transitionToRoute enter controller's init() function afte this enter Route's setupController?
init is part of Ember's internal CoreObject and is fired when an instance of almost anything is created. Generallyit isn't part of the recommended workflow, but if you do use be careful. NOTE: If you do override init for a framework class like Ember.View or Ember.ArrayController, be sure to call this._super() in your init declaration! If you don't, Ember may not have an opportunity to do important setup work, and you'll see strange behavior in your application. setupController is called every time the context(underlying model) for a route changes.

Categories : Ember Js

Creating user account in CMD/PowerShell for current logged in user
I'm not sure, what you mean, the net command also depends strongly on local/regional language settings. What you can try: net user "%username%" "%userdomain%" net user "%username%" "%logonserver%" Please see also net /? and net user /?.

Categories : Windows

JQuery Mobile - Disable "enter" / script to not allow using enter
you could try this : $("#comment").on("keypress", function (e) { if (e.which === 13) { e.preventDefault(); //alert("Keypress averted"); } }); Demo : http://jsfiddle.net/hungerpain/JTwXv/

Categories : Javascript

i need to post with enter key but have shift & enter key for new line
You need to consider the shiftKey value in both conditions. $("#post_text").keydown(function(e){ if (e.which === 13) { // Enter was pressed if (e.shiftKey) { // With shift } else { // Without shift } } }); Also note the use of which, not keyCode. jQuery standardizes the event object, making sure which is set on browsers that don't set it.

Categories : Javascript

Why doesn't Python enter the def of one class while it does enter the def of another?
Tests must begin with a name that starts with 'test'. So to run the tests in the first class, change correct_dictionary_v1 to test_correct_dictionary_v1, and correct_dictionary_v2 to test_correct_dictionary_v2. From the docs: TestLoader uses the 'test' method name prefix to identify test methods automatically.

Categories : Python

Azure ACS Credential Confusion
You need to read the associated article found at: http://blogs.msdn.com/b/alikl/archive/2011/06/05/how-to-request-swt-token-from-acs-and-how-to-validate-it-at-the-rest-wcf-service-hosted-in-windows-azure.aspx follow the steps to Configure ACS to Issue a SWT Token. The information you enter when completing the section "To configure a service identity for the REST web service" is what goes here. If you are using a Symmetric key for your password then you need the client to request a token from ACS in a different way than the example. The following code is an example of what that request looks like and was taken from http://msdn.microsoft.com/en-us/library/hh674475.aspx. See the section "SWT token requests". WebClient client = new WebClient(); client.BaseAddress = string.Format("https://mys

Categories : C#

try builtin credential first, then prompt for another
Have you tried [System.Management.Automation.PSCredential]::Empty? Are you using PS 3.0? You can set of default parameter value using $PSDefaultParameterValues.Add('Get-WMIObject:Credential',[System.Management.Automation.P SCredential]::Empty) And, when this fails, you can look for the Credential Parameter.

Categories : Authentication

C# run piece of code under different credential
Looks like there is no problem with impersonating but your code somehow tries to load the assembly System.Management.Automation.dll which is not in GAC , can you try registering this assembly in GAC and try it out again .

Categories : C#

Password from Credential Picker
You need to use a CredentialPickerOptions object for PickAsync method of CredentialPicker. After you configure CredentialPickerOptions to use Basic authentication and then you will be able to see the password user entered. var options = new Windows.Security.Credentials.UI.CredentialPickerOptions(); options.authenticationProtocol = Windows.Security.Credentials.UI.AuthenticationProtocol.basic; Windows.Security.Credentials.UI.CredentialPicker.pickAsync(options).then(/* */);

Categories : Authentication

C# Set Credential Only Once For Multiple Requests
Passing NetworkCredential to HttpWebRequest in C# from ASP.Net Page This link is showing NetworkCache, this may be a solution for you.

Categories : C#

Telling git to use credential-osxkeychain
As long as git-credential-osxkeychain is on your path, you really don't need to move it. The issue is you have a > on the command-line... that's wrong. You want: $ sudo mv git-credential-osxkeychain "$(dirname $(which git))/git-credential-osxkeychain" Better yet might be: $ sudo mv git-credential-osxkeychain "$(git --exec-path)" After that, it should work.

Categories : GIT

How can we execute Jenkins job using other user credential
Just in case there is any confusion a Jenkins job will always run as the same OS user. The Matrix based security applies to users who log into the Jenkins server and controls features like creating or launching jobs. You could configure the job to use a set of generic production credentials and then prevent your developers from invoking the job. Perhaps a better approach would be to separate the process that builds the code from the one that deploys the code. The following diagram (Taken from the xebia-france project) demonstrates how some of my favourite tools Rundeck and Nexus can be integrated with Jenkins. Finally, I highly recommend reading the following link: Using Rundeck and Chef to build devops tool chains

Categories : Jenkins

Connect to Active Directory using credential
The LDAP path to the users container is not correct. The users container is not an organizational unit but a simple container. So, you have to specify a different LDAP path. The LDAP path to the users container in your case is: LDAP://cn=Users,dc=abc,dc=def,dc=com Also consider what Hall72215 mentioned in his answer. Use the whole LDAP path directly in the constructor of the DirectoryEntry class.

Categories : C#

Git: Failed to erase credential: Element not found
Looks like the remote server is not able to authenticate you. You used an https:// URL. Therefore git uses https to connect to the remote repository. The server answers with 401 (Unauthorized) and your git client prints the above error message. Not sure, why the server does not like you. Either name/password is not correct, or something strange is going on. Try to access the https:// URL with the browser. Maybe this gives you an idea what the servers problem might be. You could also try to give name/password explicitly in the url: https://name:password@.... (But server will probably still refuse authentication.)

Categories : Windows

git credential.helper=cache never forgets the password?
Problem 1: "want my password to be forgotten" by git Problem 2 (implied): contradictory configuration settings Answer: git config --unset-all credential.helper git config --global --unset-all credential.helper git config --system --unset-all credential.helper Explanation: Git configuration is specified in three places: (repository_home)/.git/config...........................for the subject repository. ~/.gitconfig..........................for this particular user. /etc/gitconfig.......................for all users on this system. The commands noted above will remove all settings related to credentials at the repository, user and system level... which (I think) answers your question. However, it sounds like your problem may be limited to having some sort of configuration contradic

Categories : GIT

How credential and google cloud storage work?
Your first attempt (number 1) is the best way to focus on getting this to work. The code sample Marc provided uses the built-in App Engine App Identity module to securely identify the App Engine app to other Google APIs: https://developers.google.com/appengine/docs/java/appidentity/#Asserting_Identity_to_Google_APIs However, there are 2 gotchas to check: The App Identity module will not work using the local devserver. When running locally there is no way for the local server to securely identity itself to Google production APIs - so you should either look at using a service account with a downloadable key for local testing, or, easiest option (and what I'd recommend for now), is to deploy into a production App Engine environment to test. Make sure the App Engine service account email a

Categories : Google App Engine

Audit Failure, Credential Validation 4776
The famous err.exe tool tells us: for hex 0xc0000064 / decimal -1073741724 : STATUS_NO_SUCH_USER ntstatus.h The specified user does not exist. 1 matches found for "0xc0000064" You might specify the account as xyz.pqravmgr or avmgr@xyz.pqr instead.

Categories : Sql Server

git credential osxkeychain cannot execute binary file
That could be a right issue, especially if you didn't execute the: chmod u+x git-credential-osxkeychain Note that you need to download that file in a directory which is in your $PATH (which should be the case here, with /usr/bin). Try a chmod a bit more large: chmod 775 git-credential-osxkeychain

Categories : Github

Invalid Credential for Google Drive API in Android
You need to use a GoogleAccountCredential to authorize and authenticate your requests. GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(this, DriveScopes.DRIVE); Drive service = new Drive .Builder(AndroidHttp.newCompatibleTransport(), new GsonFactory(), credential) .build(); service.files().list().execute(); A quickstart tutorial is available on https://developers.google.com/drive/quickstart-android

Categories : Android

Disable credential manager for single application
You can just remove stored credentials Use CredDelete() from Advapi32 http://msdn.microsoft.com/en-us/library/windows/desktop/aa374787(v=vs.85).aspx There is a new managed library in Windows 8 to deal with Windows vault http://msdn.microsoft.com/library/windows/apps/windows.security.credentials.passwordvault.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1

Categories : C#

How store credential from OAuth2 in shared preferences
You might want to use the AccountManager API in Android. Account Manager is capable of storing the OAuth token and does the job for all Google Apps in Android. You may follow the blog here.

Categories : Android

SQL Server - How to list logins assigned to a credential?
I think something similar to this should work for you. SELECT sp.name FROM sys.server_principals AS sp INNER JOIN sys.credentials AS c ON sp.credential_id = c.credential_id WHERE c.name = 'YOUR_CREDENTIAL_NAME'; Here is more information on the sys.credentials and sys.server_principals catalog views: http://technet.microsoft.com/en-us/library/ms188754.aspx http://technet.microsoft.com/en-us/library/ms189745.aspx

Categories : Sql Server

Validate AD User Credential from External PC via Web Application
If you web server is in domain then you can use LDAP to validate the user credentials. public bool Authenticate(string userName,string password, string domain) { bool authentic = false; try { DirectoryEntry entry = new DirectoryEntry("LDAP://" + domain,userName, password); object nativeObject = entry.NativeObject; authentic = true; } catch (DirectoryServicesCOMException) { } return authentic; }

Categories : C#

Deploy ASP.NET to intranet server with host name,keeps asking me for credential
I don't see that you mentioned this, but did you try adding the port to your friendly URL? ie. http://sitename.mycompanyname.ca:888 ? Let us know! Ricky

Categories : Asp Net

UI credential popup is hiding behind the Services windows
you can check in which session the popup is running from the Taskbar. If it's in session 0 (the default session for system services)then you won't be able to see it. To get the UI in front you need run the popup with current desktop's loggedon user's session. Read this article how you can invoke the process as user http://odetocode.com/blogs/scott/archive/2004/10/29/createprocessasuser.aspx The code is in c# but you'll get the idea how it works.

Categories : C

Credential in Django URL username:password@domain.com/?param=value
You can try to use this http://djangosnippets.org/snippets/243/ . Just add decorator to your view @logged_in_or_basicauth() from snippet.

Categories : Django

Git: Failed to erase credential: Element not found tried all other solutions
I got the same message. I was ask by the winstore to type login, user and password. The password I copied direct from the Firefox Password Manger. And than I got the fail message. But than I tried it again and type the password by hand, and it worked. So I suggest you double check the login data you use. May be there is the problem.

Categories : GIT



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.