I actually have done a fair amount of research in the past, and I'll explain an alternate method that runs from the run script activity. The short answer is, it isn't as easy, so prepare yourself! As you may know, all the external reaching scripts all go through the ECC Queue, I recommend reading up on it. This trick basically creates a Probe ie making an ECC Queue input/output record, and it executes the powershell.
You'll need a defined Discovery Probe to make this work though (Discovery Definitions -> Probes -> New). Then you'll need to set the ECC queue topic to Command, and ECC queue name to be powershell C:\MyScriptHere.ps1 for example. Command executes the probe name with cmd in windows. I have mine pointed to my dev mid server's agent script folder, this is the default folder for the MID Server scripts.
After that, you need to kick off that cool probe you just made via a Run Script or Scheduled Job or BR. You can do this by using a rather undocumented SN API called SncProbe. I picked up the syntax from an OOB script include (you can also do this manually using a GlideRecord insert, but I digress). You set the source to be the local MID server, and your name, etc to match the above Probe. Note that you have to comment out the \ signs here since it's Javascript.
In case anyone got similar problem: I've contacted Alteryx support about this issue, the problem happens to the default admin field on Gallery Authentication in System Setting when you chose Windows Authentication. This field is a people picker field, as you type in it, a lookup request will be sent to your domain controller, if current Windows user doesn't have access to domain contoller, the script error pop up. To fix this problem, just login Windows as a domain account which has access to your domain controller.
I am looking to script out statistics using the below filter before dropping them so that I can recreate later. I know we can do that by Generating Scripts from SSMS but since I have to look for specific stats only I can't do it that way. I tried a few things to loop in cursor but it's not working for me. Any help would be greatly appreciated
INSERT INTO dbo.sysStatsBak
SELECT *
FROM sys.stats
WHERE OBJECT_ID = OBJECT_ID('fctext_FB')
AND name LIKE '%FB_ID'No that is not what I am after. I think I was clear in what I wanted but I'll re-iterate. I am looking for dynamically creating the statistics definition by using the query I posted so basically when I run the script it should give me output to create only the stats based on the above query predicate...like a complete create stats script definition.
Lowell--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Is there a way I can get a scripting of all tables, procs, and other objects from a database? I know there's an option to script the database but it only gave me some sort of top level script, certainly not a script to create all tables, procs, udfs, .etc.
I wrote an open source command line utility named SchemaZen that does this. It's much faster than scripting from management studio and it's output is more version control friendly. It supports scripting both schema and data.
We ended up using a combination of SSMS script generation to extract schema and data, and then use our own database tool which allows keyword parsing and token based replacement in scripts. It also ensures scripts are only applied once.
If you need to do it programmatically, you can use the SQL DMO library (OLE) against SQL Server 2000, but more likely you may wish to use the SQL SMO library (native .NET libraries) against SQL Server 2005 and later.
I have ArcGIS Pro 2.9.5 installed on my desktop. I have ArcGIS Enterprise 10.9.1 installed on our server. I have administrative access. Please help me find a way, in Python, to list all services that use the ArcMap runtime, in preparation for our upgrade to Enterprise 11. Here is what I have so far:
I have tried accessing several properties of both known_arc*_service objects, and cannot find any indicator in Python as to which one uses the ArcMap runtime and which uses the ArcPro one. Therefore, I can't programmatically find them. We have hundreds of services and it would be great to do this programmatically and not by loading 10 items at a time in ArcGIS Server Manager.
Hi @RogerDunnGIS, I know you're looking to gain this information for your ArcMap-based services via Python but would the UpdateArcMapServices utility help you in this instance? Analysis mode would provide an inventory of your services without migrating them. This blog also goes into a bit more detail about this.
However, ArcGIS Server 10.9.1 offers a button in ArcGIS Server Manager that allows a person to convert their ArcMap run-time service into an ArcPro run-time service. Meanwhile, the source of the service remains the same: an .mxd document. When you look at ArcGIS Server Manager, it says right there under the service description which run-time it's using; I just don't know why it's been so hard for me to find that piece of data using the API.
I appreciate your reply. I'm aware that Server makes a copy of the original ArcMap document, and that sometimes there are changes to it, like when data is copied to the server. What I was trying to explain is that you can have an ArcGIS Server service running with the Pro run-time, even though it was originally published with ArcMap. I explained in the last reply how a user might do that. Once the conversion is done, the original ArcMap document remains in the folder, and Server Manager will continue to report that the original document was an .mxd, even though a service is running with the Pro run-time.
As a Python programmer, I sometimes forget about other tools available that aren't already in ArcToolbox. Of course, Esri provides many tools to users and administrators that are only available in some environments, like Command Prompt. Thank you for your solution.
Currently, on my Jira Server, I manage and package all my code in the Script Editor panel of Scriptrunner. This is beneficial because I can separate my code logic and reuse class definitions across various scripts, behaviors, and validators using the package definition.
However, I was surprised to find that the Script Editor panel is not available in the Cloud version of the app (unless I missed something but it is in the doc: -between-scriptrunner-for-jira-server-and-jira-cloud/feature-parity). This is soooooo surprising and I couldn't understand why ... it was so usefull ...
Hi @Ram Kumar Aravindakshan _Adaptavist_ Thank you for your response.
That's what I had read, but I was concerned that a part of my logic, which is based on the use of Jira's Java API and my package definition for reusability (using stored scripts and Script Editor), would become largely obsolete.
1. The Java API cannot be used anymore, and scripts should be designed to use the REST API instead (for more information: -docs.connect.adaptavist.com/jira/).
2. The capability to define scripts in files no longer exists, only inline scripts are available, which are not reusable by definition
3. It is not possible to save and manage custom scripts snippets from ScriptConsole or Browse page)
4. Custom REST Endpoints no longer exist, so reusable scripts cannot be defined and used as RestEndpoint neither.
(Other: 5. I was using Behaviours with javascript injection in description fields in JSD/JSM's forms, this is no longer possible ?)
Microsoft Scripting Guy, Ed Wilson, is here. This morning I am sipping a nice cup of Darjeeling tea. I added a bit of peppermint leaves, spearmint leaves, orange peel, licorice root, and a cinnamon stick. The result is very refreshing, with just a little bit of a kick to help jump start one's scripting. I was reviewing my scri...@microsoft.com email this morning, and I ran across the following question:
My Windows PowerShell Scripting page in the Script Center has over a dozen hours of training for Windows PowerShell basics, but there is nothing specific to SQL Server and Windows PowerShell other than the information I gave you earlier.
I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at scri...@microsoft.com, or post your questions on the Official Scripting Guys Forum. See you tomorrow. Until then, peace.
Hi All
Is it possibel to write a script that will pull data automatically off a server. Also how does ODBC work, is this a connection to a server to retrieve data. And lastly to clarify, to use IDEA Server, I would need to connect from my desktop to the IDEA Server and work off there?
Thank you
Regards
Aveen
For server do you mean an IDEAServer or just a server you have access to? I am not sure for the IDEAServer as unfortunately I have never worked in that environment and I don't have access to it to test it out.
ODBC stands for Open Database Connectivity and they are interfaces that allow you to connect directly with different types of databases. Usually on your computer you would have ODBC drivers for Excel and Access but you can download ODBC drivers for most databases. The ODBC has to be properly configured to access the database such as giving the drivers the location, passwords, etc on how to access the database. Once it is properly installed it will allow you, through the IDEA import control, to connect directly with the database and select the tables / fields you wish to import into IDEA and the data will be imported directly as an IDEA file. They are great to have. If you have excel or access on your machine you might want to try them out. Also there is lots of information on using ODBC dirvers on the net.
b1e95dc632